PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
redisResponse (Type of variable)
In french: redisRéponse
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.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
Example
INTERNAL PROCÉDURE AfficheRésultat(r is redisResponse, sIdent="")
SWITCH r.Type
CASE redisTypeInt
Trace(sIdent + "entier: " + r.Integer)
CASE redisTypeError
Trace(sIdent + "erreur: " + r.String)
CASE redisTypeStatus
Trace(sIdent + "status: " + r.String)
CASE redisTypeNil
Trace(sIdent + "Nil")
CASE redisTypeArray
Trace(sIdent + "tableau: ")
FOR EACH r2 OF r.Table
AfficheReponse(r2, sIdent + TAB)
END
CASE redisTypeBuffer
Trace(sIdent + "buffer en chaine: " + r.String)
Trace(sIdent + "buffer en hexa: " + BufferToHexa(r.Buffer))
END
END
 
r1 is redisResponse = RedisExecuteCommand(gRedis, "GET cléString")
AfficheRésultat(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 the Type property corresponds to the redisTypeBuffer constant.
This property is read-only.
StringCharacter string
  • If the Property Type matches the constant redisStatus, this Property contains the string corresponding to the report returned.
  • If the Property Type matches the constant redisError, this Property contains the error message.
  • If the Property Type matches the constant redisBuffer, this Property contains the buffer converted to a string using UTF8 encoding.
This property is read-only.
IntegerIntegerInteger value if the property Type corresponds to the constant redisTypeInt.
This property is read-only.
ArrayArray of redisResponseIf the property Type corresponds to the constant redisTypeArray, this property contains an array of variables of type redisResponse.
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 read-only.

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 version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment