Undocumented feature if and exclamation mark

General questions about NeoBook

Moderator: Neosoft Support

Locked
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Undocumented feature if and exclamation mark

Post by HPW »

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
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Undocumented feature if and exclamation mark

Post by Neosoft Support »

The exclamation point tells NeoBook to leave the contents of the parameter alone and not modify it at all.
NeoSoft Support
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Undocumented feature if and exclamation mark

Post by HPW »

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
virger
Posts: 540
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Undocumented feature if and exclamation mark

Post by virger »

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
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Undocumented feature if and exclamation mark

Post by Neosoft Support »

Variables are always resolved and are not affected by the exclamation point.
NeoSoft Support
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Undocumented feature if and exclamation mark

Post by Gaev »

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
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Undocumented feature if and exclamation mark

Post by dpayer »

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
Locked