Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function Return Value - BrowseForFolder
#2
if(something)

is the same as

if(something not = 0)

In this case, the return value of the function is that "something".

----

Code:
Copy      Help
str s
if(BrowseForFolder(s "$windows$"))
,out "OK"
else
,out "Cancel"

;or
if(BrowseForFolder(s "$windows$")!=0)
,out "OK"
else
,out "Cancel"

;or
if(!BrowseForFolder(s "$windows$"))
,out "Cancel"
else
,out "OK"

;or
if(BrowseForFolder(s "$windows$")=0)
,out "Cancel"
else
,out "OK"

;or
int ok=BrowseForFolder(s "$windows$")!=0
if(ok)
,out "OK"
else
,out "Cancel"

;or
ok=BrowseForFolder(s "$windows$")!=0
if(ok!=0)
,out "OK"
else
,out "Cancel"

----

Small error in documentation. Must be " Returns a nonzero value on OK, 0 on Cancel."[/code]


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)