Source language: Translate to:

Invert data

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Invert data

Postby Rox_Folder » Thu Jun 08, 2006 1:44 pm

Hi all,
How are yours? I hope well
My question is if is possible to invert, revert ou mirror, i dont know the exact term, but for example, i my database display a text like...yadot (today) and for the user display the correct text.

more cleary

turn whole texts on my database invert, but display to user with the correct text.

thank you
User avatar
Rox_Folder
 
Posts: 10
Joined: Wed May 31, 2006 11:55 am

Postby Sam Cox » Thu Jun 08, 2006 2:21 pm

String Reverse Character Order
SAM COX NOVEMBER 9, 2003

Usage
Code: Select all
SetVar "[String]" "Reverse Any String"
Gosub "StrReverse"

Result
Code: Select all
[String] = "gnirtS ynA esreveR"

Subroutine
Code: Select all
:StrReverse
..  input [String] to reverse
..  output [String] reversed
If "[String]" "<>" ""
    SetVar "[Temp]" ""
    StrLen "[String]" "[StrLen]"
    Loop "1" "[StrLen]" "[Index]"
        SubStr "[String]" "[Index]" "1" "[Char]"
        SetVar "[Temp]" "[Char][Temp]"
    EndLoop
    SetVar "[String]" "[Temp]"
Endif
Return
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Rox_Folder » Thu Jun 08, 2006 2:46 pm

Thank you mister,

works like a charm, but, basead with your code i try to use my database to display the reverse words but withou sucess

I change the "Reverse Any String" to variable of my database, and nothings happens, i will continue trying my best with the code, if i get right i will post here.

one more time thank you Sam
The [TRUE] is in here.
User avatar
Rox_Folder
 
Posts: 10
Joined: Wed May 31, 2006 11:55 am

Postby Trainman » Sat Jun 10, 2006 11:40 am

Thanks Sam!

I couldn't get my head around how to reverse a string of text either. This line gave me one of those "A-HA!" moments:

Code: Select all
SetVar "[Temp]" "[Char][Temp]"


Thanks,
John
Trainman
 
Posts: 113
Joined: Fri Apr 01, 2005 10:21 am
Location: England

Postby Sam Cox » Sat Jun 10, 2006 4:44 pm

If you were already using HPW's newLisp plugin — which, by the way, is highly recommended — you could write:
Code: Select all
hpwNewLispCall "(reverse {[String]})" "[Reversed]"
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Cipolla » Mon Jun 12, 2006 12:12 am

Just to make it complete, there is also a (free) plugin called
"RlFunctions" with one action to handle this:

Code: Select all
rlStrRev "[Orig]" "[Rev]"


RlFunctions is a very good plugin with many usefull actions. You could find it here:



http://rlplugins.software-zone.com/
Greetings from Germany
Klaus
User avatar
Cipolla
 
Posts: 166
Joined: Fri Apr 01, 2005 1:45 am
Location: Germany


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest