Source language: Translate to:

Spaces() function

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Spaces() function

Postby David de Argentina » Mon Jul 02, 2007 12:08 pm

Hi Dave,

Each time i need create a [n] spaces string, it is very hard to do...

i think it would be usefull something like this:

Spaces "[n]" "[target_variable]"

thanks in advance,

David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Gaev » Mon Jul 02, 2007 12:22 pm

David de Argentina

a) in your pub's StartUp section, create a variable with lots of spaces like this ...
Code: Select all
SetVar "[mys]" "          " ... ten spaces
SetVar "[mys]" "[mys][mys][mys][mys][mys][mys][mys][mys][mys][mys]" ... hundred

b) Now whenever you need [n] spaces ...
Code: Select all
SubStr "[mys]" "1" "[n]" "[target_variable]"


You can adjust the initial value of [mys] to suit your maximum possible requirement ... or you can build a Function like ...
Code: Select all
Call "gkSpaces" "[n]" "[target_variable"

... that will compare [n] with length of [mys] ... and add (concatenate) [mys] variable to [target_variable] as many times as necessary.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron