How to group a test and its processing on a single line? - Forum

Forum Navigation
You need to log in to create posts and topics.

How to group a test and its processing on a single line?

Hello,

I am continuing my discovery of VN Win, which requires me some time to adapt after having invested myself for two decades in another excellent RAD (unfortunately now stopped). I have several remarks to present, but I know that VN Win is currently evolving, so I will be patient. On the other hand, I came across a problem that I am submitting here.

I am looking for a way to perform a simple test like IF (this file exists) THEN (action). However, unless I am misinterpreting, I understand that I am obliged to go through a variable to place the result of the test before being able to use it :

FileExists "myFile.ext" "[result]"

if "[result]" "=" "false"
    AlertBox "Status" "Missing file"
EndIf

Is there a way to make the code lighter by not using a variable and thus grouping the test and its processing on the same line, something like this:

if FileExists "myFile.ext" "[result]" "=" "false"
    AlertBox "Status" "Missing file"
EndIf

That's it for today, with all my thanks :).

@fredisland no, that's not possible.
Sorry!

Fredisland has reacted to this post.
Fredisland

Thank you for you reply. So I will create at the beginning of my programs a global variable [result] which will be used for all the tests.

Open chat
1
Do you need more info?
Hi, do you have any doubt?