PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV, WEBDEV 24 feature!
  • Properties specific to the description of redisResponse variables
  • WLanguage functions that use the redisResponse type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The type redisResponse makes it possible to define all the advanced characteristics of a response received by RedisExecuteCommand or RedisPipelineGet. The characteristics of this response can be known using different WLanguage properties.
Note: See Declaring a variable for more details.
Example
INTERNAL PROCEDURE DisplayResult (r is redisResponse, sIdent="")
SWITCH r..Type
CASE redisTypeInt
Trace(sIdent + "integer: " + r..Integer)
CASE redisTypeError
Trace(sIdent + "error: " + r..String)
CASE redisTypeStatus
Trace(sIdent + "status: " + r..String)
CASE redisTypeNil
Trace(sIdent + "Nil")
CASE redisTypeArray
Trace(sIdent + "array: ")
FOR EACH r2 OF r.Array
ShowResponse(r2, sIdent + TAB)
END
CASE redisTypeBuffer
Trace(sIdent + "buffer in string: " + r..String)
Trace(sIdent + "buffer in hexa: " + BufferToHexa(r..Buffer))
END
END

r1 is redisResponse = RedisExecuteCommand(gRedis, "GET keyString")
DisplayResult(r1)
Remarks

Properties specific to the description of redisResponse variables

The following properties can be used to handle a Redis response:
Property nameType usedEffect
BufferBufferBinary value if ..Type corresponds to the constant redisTypeBuffer.
This property is available in read-only.
StringCharacter string
  • If ..Type corresponds to the constant redisStatus, this property contains the string corresponding to the returned state.
  • If ..Type corresponds to the constant redisError, this property contains the error message.
  • If ..Type corresponds to the constant redisBuffer, this property contains the buffer (converted into string using UTF8 encoding).
This property is available in read-only.
IntegerIntegerInteger value if ..Type corresponds to the constant redisTypeInt.
This property is available in read-only.
ArrayArray of redisResponseIf ..Type corresponds to the constant redisTypeArray, this property contains an array of redisResponse variables.
TypeIntegerType of the result. This type can correspond to one of the following constants:
  • redisTypeBuffer: The result corresponds to a buffer.
  • redisTypeInt: The result corresponds to an integer.
  • redisTypeError: The result corresponds to an error.
  • redisTypeNil: The result has no value.
  • redisTypeStatus: The result corresponds to a status.
  • redisTypeArray: The result corresponds to an array.
This property is available in read-only.

Note: These properties can be handled by using one of the following syntaxes:
  • <Variable name>..<Property name>
  • <Variable name>.<Property name>

WLanguage functions that use the redisResponse type

Versions 24 and later
RedisExecuteCommand
New in version 24
RedisExecuteCommand
RedisExecuteCommand
Executes a command on a Redis server and retrieves the result.
Versions 24 and later
RedisPipelineGet
New in version 24
RedisPipelineGet
RedisPipelineGet
Retrieves the result of the execution of a Redis command that was added by RedisPipelineAdd.
Minimum required version
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment