Source language: Translate to:

Undocumented feature if and exclamation mark

General questions about NeoBook

Moderator: Neosoft Support

Undocumented feature if and exclamation mark

Postby HPW » Fri Oct 21, 2016 10:09 am

Hello,

Is there a undocumented feature with if and exclamation mark?
I find 3 cases in the doc where the exclamation mark has special meaning.
Does it make if argument-variables case-sensitiv?

Code: Select all
SetVar "[t1]" "Ruby"
SetVar "[t2]" "RUBY"

Alertbox "![t1]" "![t2]"
Alertbox "[t1]" "[t2]"

If "![t1]" "<>" "![t2]"
 Alertbox "Result1" "Strings are indeed different."
Else
 Alertbox "Result1" "Strings are equal."
EndIf

If "[t1]" "<>" "[t2]"
 Alertbox "Result2" "Strings are indeed different."
Else
 Alertbox "Result2" "Strings are equal."
EndIf


Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Undocumented feature if and exclamation mark

Postby Neosoft Support » Sun Oct 23, 2016 11:08 am

The exclamation point tells NeoBook to leave the contents of the parameter alone and not modify it at all.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Undocumented feature if and exclamation mark

Postby HPW » Mon Oct 24, 2016 8:01 am

The exclamation point tells NeoBook to leave the contents of the parameter alone and not modify it at all.

The doc says that math operations are not resolved. What about variable replacment?

The sample code show the variables gets resolved and replaced by the content.
But the if condition behaves different.
When I Change t1 and t2 to exact the same string "Ruby" then both if show the same result.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Undocumented feature if and exclamation mark

Postby virger » Mon Oct 24, 2016 9:12 am

Grandioso, utilisimo, comprobado
Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=3
Name=PushButton1
X=21
Y=14
W=226
H=41
Anchor=0
Text=[ab1[c]] --- [ab2[c]]
Align=2
ImageStyle=0
ObjAction=setvar "[abc1]" "1,2,3,4,5,6,7,8,9,0,q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m,ñ,á,í,ó,ú,"¶strupper "[abc1]" "[abc2]"¶strparse "[abc1]" "," "[ab1]" "[x]"¶strparse "[abc2]" "," "[ab2]" "[x]"¶loop "1" "[x]" "[c]"¶    if "![ab1[c]]" "=" "![ab2[c]]"¶        alertbox "Dif" "[ab1[c]] --- [ab2[c]]"¶    endif¶endloop
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Tahoma
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Undocumented feature if and exclamation mark

Postby Neosoft Support » Mon Oct 24, 2016 8:42 pm

Variables are always resolved and are not affected by the exclamation point.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Undocumented feature if and exclamation mark

Postby Gaev » Tue Oct 25, 2016 5:33 am

This subject (of the handling of ! Exclamation Mark) deserves a (Pinned) Topic on these Forums ... so we can add all sorts of examples (and how each one is resolved) ... all in one place.

Later, perhaps replicated to the Help file.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Undocumented feature if and exclamation mark

Postby dpayer » Wed Oct 26, 2016 9:55 am

Gaev wrote:This subject (of the handling of ! Exclamation Mark) deserves a (Pinned) Topic on these Forums ... so we can add all sorts of examples (and how each one is resolved) ... all in one place.

Later, perhaps replicated to the Help file.



Ditto (an American expression meaning "I agree with what was said " )

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest