Evaluation confusion

Discuss RoboTask here
Post Reply
rtwright68
Posts: 2
Joined: Mon Feb 17, 2020 4:31 pm

Evaluation confusion

Post by rtwright68 »

I am assigned data from a SQL Query to a variable named ORDERED_SQFT (it is just numbers i.e. 1453534.879)

I want to take that value and divide by 1000 (multiply by .001)

I created an EVALUATE action that looks as follows:

Expression to Evaluate:
.001*{ORDERED_SQFT}

Assign to Variable:
ORDERED_MSF

It fails with: Error in expression ".001*"

Not sure what I am missing?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Evaluation confusion

Post by Oleg »

It seems the variable ORDERED_SQFT contains the empty value
check it please. You can output the value to the task log
I test this in simple example, it works
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1251730006
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task160"
Hide=INTEGER|0
ID=INTEGER|558365431
LogOnAsUser=INTEGER|1
Name=STRING|"test evaluate"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""MYVAR"" with value ""1453534.879"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"MYVAR"
varvalue=STRING|"1453534.879"

[Actions\Action2]
ActionID=STRING|"A_SCRIPT_VBEVALUATE"
Enabled=INTEGER|-1
Name=STRING|"VB Evaluate"
Params=FOLDER

[Actions\Action2\Params]
expression=STRING|".001*{MyVar}"
linecount=STRING|"0"
loadfromfile=STRING|"1"
variable=STRING|"res"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{res}"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"{res}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
Oleg Yershov
Post Reply