Source language: Translate to:

How to convert | to character

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

How to convert | to character

Postby Grandpa1 » Sat Feb 12, 2011 4:38 am

Hi
I want to use | in my string but it converted to a new line how i can use a variable like [#34] for it? :(
Grandpa1
 
Posts: 33
Joined: Fri Jan 09, 2009 11:09 am

Postby asawyer13 » Sat Feb 12, 2011 5:36 am

Looks like it would be [#124]
asawyer13
 
Posts: 123
Joined: Sun Aug 22, 2010 6:13 pm

Postby Grandpa1 » Sat Feb 12, 2011 7:40 am

thanks for your help..I have a problem yet.. :( :(
I want to save this variable to end of a file..
Code: Select all
SetVar "[line]" "Item, [proxy1]=Disable proxy servers & Set preference,  [#34]Proxy[#124]HTTP server=[proxy2] [#34] & Set preference,  [#34]Proxy[#124]HTTPS server=[proxy2][#34] & Set preference,  [#34]Proxy[#124]FTP server=[proxy2][#34] & Enable proxy servers"

It must be in a single line...but when I use
Code: Select all
FileWrite "[Menu_Configuration]" "All" "[line]"

It will become to 4 lines(its because of | charackter that is in my line...I cant remove this charackter..can someone help me how to solve my problam? :roll: :roll:
Grandpa1
 
Posts: 33
Joined: Fri Jan 09, 2009 11:09 am

Postby Gaev » Sat Feb 12, 2011 8:01 am

am2222:

Try and place the exclamation mark ! in both your commands ...
Code: Select all
SetVar "[line]" "!Item, [proxy1]=Disable proxy servers & Set preference,  [#34]Proxy[#124]HTTP server=[proxy2] [#34] & Set preference,  [#34]Proxy[#124]HTTPS server=[proxy2][#34] & Set preference,  [#34]Proxy[#124]FTP server=[proxy2][#34] & Enable proxy servers"

FileWrite "[Menu_Configuration]" "All" "![line]"
User avatar
Gaev
 
Posts: 3734
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Grandpa1 » Sat Feb 12, 2011 8:11 am

Thanks my friend..It works....
Can you explain for me what does ! do in codes? :D :D :o
Grandpa1
 
Posts: 33
Joined: Fri Jan 09, 2009 11:09 am

Postby Gaev » Sat Feb 12, 2011 9:34 am

am2222:
Can you explain for me what does ! do in codes?
a) simple explanation ...
Code: Select all
SetVar "[abc]' "2 + 2"
SetVar "[xyz]' "!2 + 2"
... will result in [abc] containing 4 and [xyz] containing the text string 2 + 2.

In other words you are telling NeoBook to NOT do any calculations with the values specified after the Exclamation character.

Another place this comes in handy is when a file/folder contains the back-slash characters (e.g. c:\folder\file.ext) ... without the Exclamation character, NeoBook tries to do division of items.

In your particular case, the | is normally interpeted as a new line character.


b) For more on this, do a search of this forum with word "exclamation"


@Dave of Neosoft ... given the frequency of times when this discussion comes up on the forum ... perhaps you can "pin" an official explanation of this in the NeoBook Knowledgebase section of this forum.
User avatar
Gaev
 
Posts: 3734
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Grandpa1 » Sat Feb 12, 2011 9:39 am

Thanks man...You are great :D :D
Grandpa1
 
Posts: 33
Joined: Fri Jan 09, 2009 11:09 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest