Extract file with variable malfunction

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Extract file with variable malfunction

Post by Rukbunker »

Hey Oleg,

After a "Create File List" function, 1 filename is saved into the variable {FILE}. This is good and how it should be. It's a ZIP file, but the name differs every time. After that, I want to extract that ZIP file.
When I use the "Extract Files" function with {FILE}, an error occurs with no reason. When I use the full patch (EXACTLY the same as in the variable) it works perfectly. How come that this function doesn't accepts variables?

Image
upload pic
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Extract file with variable malfunction

Post by Oleg »

I wrote a little example (see below)
It works

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task331"
Hide=INTEGER|0
ID=INTEGER|-248401785
LogOnAsUser=INTEGER|1
Name=STRING|"extract files (name in variable)"
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_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FILE"" with value ""D:\Temp\zip\bin.zip"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FILE"
varvalue=STRING|"D:\Temp\zip\bin.zip"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDER"" with value ""{ExtractFilePath({File})}"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"1"
varkind=STRING|"1"
varname=STRING|"FOLDER"
varvalue=STRING|"{ExtractFilePath({File})}"

[Actions\Action3]
ActionID=STRING|"A_ZIP_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"Extract Files"
Params=FOLDER

[Actions\Action3\Params]
destdir=STRING|"{folder}"
filetounzip=STRING|"{File}"
overwrite=STRING|"0"
password=STRING|"2693725194264782545612397"
passwordmode=STRING|"0"
skipolderfiles=STRING|"0"
usefoldernames=STRING|"1"

Maybe the problem somewhere else.
Are you sure that variable contains correct name?
Oleg Yershov
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Extract file with variable malfunction

Post by Rukbunker »

I have imported your task. The value of the variable is being saved correctly, but as said: unzipping with the usage of {MyVar} is not working. The full path works. See for yourself:
Image
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Extract file with variable malfunction

Post by Oleg »

Why does it work for me?
see video: https://youtu.be/9AvlK4t-98U
Oleg Yershov
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Extract file with variable malfunction

Post by Oleg »

Could you send your task to me?
It seems the problem is in the task. I don't see your example, only some screenshots
Oleg Yershov
Post Reply