While our host is adding many of these functions to the base language, I thought I would upload a little library of string functions I've been working on. I have several others in the works including a translate and some helpful but obscure functions around word matching.
I hope these are helpful, though.
Bill
String functions
-
- Posts: 21
- Joined: Thu Nov 14, 2013 4:12 pm
String functions
- Attachments
-
- string.txt
- library of sting functions. Suitable for use via {/string.txt/}
- (4.7 KiB) Downloaded 362 times
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: String functions
To your information, you can always redefine existing array with better size.
-
- Posts: 21
- Joined: Thu Nov 14, 2013 4:12 pm
Re: String functions
Thanks,
I did not realize I could just redefine the array on the fly...good way to clear it. Can I change the sizes of each dimension in a multi-dimension array?
Is that a costly process interns of computing time?
In later basics there is a REDIM statement to do this and it usually has a PRESERVE keyword to preserve the contents of the array. But it is usually a costly process to do so.
I did not realize I could just redefine the array on the fly...good way to clear it. Can I change the sizes of each dimension in a multi-dimension array?
Is that a costly process interns of computing time?
In later basics there is a REDIM statement to do this and it usually has a PRESERVE keyword to preserve the contents of the array. But it is usually a costly process to do so.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: String functions
You can change sizes of each dimension in a multi-dimension array with just another DIM command. But you cannot change number of dimensions when re-declaring it.wdmcdaniel wrote:Thanks,
I did not realize I could just redefine the array on the fly...good way to clear it. Can I change the sizes of each dimension in a multi-dimension array?
Is that a costly process interns of computing time?
In later basics there is a REDIM statement to do this and it usually has a PRESERVE keyword to preserve the contents of the array. But it is usually a costly process to do so.
Speed of DIM command is equal whether it is first declaration of array or it is a re-declaration. Definitely it is faster to re-declare an array than clearing it with zeroes in program.
- Dutchman
- Posts: 851
- Joined: Mon May 06, 2013 9:21 am
- My devices: iMac, iPad Air, iPhone
- Location: Netherlands
- Flag:
Re: String functions
Thanks for the lib.
I have no experience with it yet, but I will certainly use it until Smart Basic has these extensions.
Actually I considered it to program it myself, but you solved my problem.
I like your coding style with comments, indentation, separation lines etc.
I have no experience with it yet, but I will certainly use it until Smart Basic has these extensions.
Actually I considered it to program it myself, but you solved my problem.
I like your coding style with comments, indentation, separation lines etc.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: String functions
Yes, coding style is really neat!
-
- Posts: 21
- Joined: Thu Nov 14, 2013 4:12 pm
Re: String functions
Thanks for the compliments. Line by line comments are a habit from my assembler coding days. I find that if I don't comment almost line by line, then I can't recall why I wrote a line of code six months later
I'll bring out another version of the library shortly...adding a lot of useful functions from the REXX language.
Bill
I'll bring out another version of the library shortly...adding a lot of useful functions from the REXX language.
Bill
- Dutchman
- Posts: 851
- Joined: Mon May 06, 2013 9:21 am
- My devices: iMac, iPad Air, iPhone
- Location: Netherlands
- Flag:
Re: String functions
That remembers me to a period thirty years ago
Assembler was fun, but time-consuming
Assembler was fun, but time-consuming