Post Reply 
Bug or Not? Taking STRING of a string whilst making leading zeros
01-30-2018, 09:36 PM (This post was last modified: 01-30-2018 09:37 PM by Carlos295pz.)
Post: #13
RE: Bug or Not? Taking STRING of a string whilst making leading zeros
The recursive function may look like this:
Code:
EXPORT ZEROS(NZ)
BEGIN
   IFTE(NN,"0"+ZEROS(NZ-1),"")
END;

Speed may not be important for that code, but it may be better to use ITERATE instead of tail.
Code:
EXPORT ZEROS(NZ)
BEGIN
   ITERATE(X+"0",X,"0",NZ)
END;

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Bug or Not? Taking STRING of a string whilst making leading zeros - Carlos295pz - 01-30-2018 09:36 PM



User(s) browsing this thread: 1 Guest(s)