mibuso.com

Microsoft Business Solutions online community
It is currently Fri May 24, 2013 8:50 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Solved] Reverse a string
PostPosted: Sun Aug 24, 2008 8:01 am 
Offline

Joined: Sun Aug 24, 2008 7:31 am
Posts: 5
Location: Bochum
Country: Germany (de)
Hello,

is there any function to reverse a string

(like: String_1= "ABC", String_2="CBA") ?

In other programming languages there are special functions for that but I haven't figured out a function solving this problem in Nav.


Last edited by Chap on Sun Aug 24, 2008 11:02 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 24, 2008 9:28 am 
Offline

Joined: Tue Oct 14, 2003 2:59 pm
Posts: 471
Location: Dortmund - Germany
Country: Germany (de)
There is no predefined function for that, but you can write it yourself:

Code: Select all
J := 0;
FOR I := STRLEN(YourText) DOWNTO 1 DO BEGIN
  J += 1;
  ReverseText[J] := YourText[I];
END;

_________________
Timo Lässer
Navision Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]


Top
 Profile  
 
 Post subject: Re:Reverse String
PostPosted: Sun Aug 24, 2008 9:43 am 
Offline

Joined: Sun Aug 24, 2008 7:31 am
Posts: 5
Location: Bochum
Country: Germany (de)
Hello Timo,

thanks a lot for your reply. :D


Top
 Profile  
 
 Post subject: Re: [Solved]Reverse a string
PostPosted: Sun Aug 24, 2008 12:15 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Aug 14, 2001 7:01 am
Posts: 5315
Location: Prague
Country: Czech Republic (cz)
Chap wrote:
Hello,

is there any function to reverse a string

(like: String_1= "ABC", String_2="CBA") ?

In other programming languages there are special functions for that but I haven't figured out a function solving this problem in Nav.


Hi Chap.

Navision is not a programming language, its and ERP product with an integrated development environment. Please don't go down the path of looking for C++ and Fortran and Prolog constructs or you will just end out banging your head against a wall.

Work with NAV and you will grow to love it. :mrgreen:

_________________
David Singleton
Dynamics NAV Freelancer
Dynamics Book
Go-Live International


Top
 Profile E-mail WWW  
 
 Post subject: Re: Reverse a string
PostPosted: Fri May 11, 2012 8:37 pm 
Offline

Joined: Fri Oct 14, 2005 11:03 pm
Posts: 27
Location: usa
This code works perfectly well
[code][
J := 0;
FOR I := STRLEN(YourText) DOWNTO 1 DO BEGIN
J += 1;
ReverseText[J] := YourText[I];
END;
/code]

Any I deas how to make it work with an array? YourText[k])
FOR I := STRLEN(YourText[k]) DOWNTO 1 DO BEGIN
J += 1;
ReverseText[k][J] := YourText[I];
END;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: