forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


empty varible question

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Feb 06, 2005 7:22 pm    Post subject: empty varible question Reply with quote

hello all

I have a problem that i can't firgure out..i know there has to be a way to do this but i must be over looking something..

how to have a varible check to see if its "empty" if so do something else

i have tried equal, not equal, etc and i still get a erorr cuase the varible is empty Sad


thanks

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Feb 06, 2005 8:27 pm    Post subject: Reply with quote

Hey tim,

If your var contains visible chars, ya can use:

if @not(%%myvar)
(true if var is empty)

or

if %%myvar
(true if var is not empty)

If a var only contains blanks etc. this does not work.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Feb 06, 2005 9:11 pm    Post subject: Reply with quote

thanks but yea my varible does contain blanks Sad

looks like i will have to re-do this part of the script Sad

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Sun Feb 06, 2005 9:17 pm    Post subject: Reply with quote

if you mean this example

%a = "text text text"
or
%a =

couldn't you use
Code:

if @null(%a)
  # null
  info "%a is null"
else
  # not null
  info "%a =" %a
end

_________________
Visual Dialogscript 5
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 07, 2005 7:46 am    Post subject: install from within a zip file Reply with quote

don't worry - my browser is playing tricks Embarassed
_________________


Last edited by Serge on Mon Feb 07, 2005 7:49 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 07, 2005 7:48 am    Post subject: Reply with quote

what about to deal with cases where variable contains spaces,

Code:

if @null(@trim(%a))
info "%a" is empty
else
info "%a" is not empty
end


serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Feb 07, 2005 8:43 am    Post subject: Reply with quote

The example I posted works unless the variable contains
nothing but blanks, tabs etc. such as:

%%myvar = " "

I never thought about @null() Serge, but it appears
to detect empty vars correctly. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Feb 08, 2005 5:11 am    Post subject: Reply with quote

i forgot about null to Sad thanks all this will help me alot Smile
_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group