FileRequester Cancelled

Find quick help here to get you started with Hollywood
Post Reply
User avatar
NubeCheCorre
Posts: 56
Joined: Mon Mar 19, 2012 1:24 am
Contact:

FileRequester Cancelled

Post by NubeCheCorre » Mon Feb 24, 2014 10:25 pm

i use this code (here is only a part) to know if the user press the cancel button and end the program, but i get an error:

Code: Select all

pattern$ = "jpg|jpeg|bmp|tif|gif|png"

title$ = "Scegli i files da unire orizzontalmente"

f$ = FileRequest(title$,pattern$,#REQ_MULTISELECT)
If f$ = ""
	Print("Requester annullato!")
	End()
Else
	NPrint("Path:", PathPart(f$[0]))
	NPrint("Files selezionati:", ListItems(f$) - 1)
EndIf
The error is:

"Wrong operator for this type"

What does it mean? As far as I understand I have to use another operator, but what to use instead of "=" to check if f$ is empty?

User avatar
JurassicC
Posts: 35
Joined: Fri May 25, 2012 9:48 pm

Re: FileRequester Cancelled

Post by JurassicC » Tue Feb 25, 2014 10:24 pm

Your using REQ_MULTISELECT so you'll need a table defined to put your multirequest into.

change it to

f = FileRequest(title$,pattern$,#REQ_MULTISELECT)
if f[0] = ""
DebugPrint("Requester annullato!")
End()
Else
DebugPrint("Path:", PathPart(f[0]))
DebugPrint("Files selezionati:", ListItems(f) - 1)
EndIf
AmigaOne X1000 - RadeonHD 7870, 4GB RAM - AmigaOS 4.1ß
AmigaOne X5000 - Radeon R7 250, 2GB RAM - AmigaOS 4.1ß

User avatar
NubeCheCorre
Posts: 56
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: FileRequester Cancelled

Post by NubeCheCorre » Wed Feb 26, 2014 11:05 pm

Thanks it works! :)

User avatar
Juan Carlos
Posts: 502
Joined: Mon Sep 06, 2010 1:02 pm
Contact:

Re: FileRequester Cancelled

Post by Juan Carlos » Sat Mar 29, 2014 2:09 pm

I have a doubt how give the defdir$ because I have this problem in this case:
filetxt$=FileRequest("Choose txt file:" , ".txt", "Idiomas/")

where "Idiomas/" in theory is the defdir$ but the requester no do nothing.

User avatar
airsoftsoftwair
Posts: 3121
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FileRequester Cancelled

Post by airsoftsoftwair » Sat Mar 29, 2014 7:20 pm

Read the documentation. You're passing arguments in the wrong order (defdir$ is the fourth argument, not the third)

Post Reply