Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Several useful functions for AGK

Author
Message
Bored of the Rings
User Banned
Posted: 18th Dec 2018 14:39 Edited at: 18th Dec 2018 22:27
[edit]]
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 18th Dec 2018 15:26 Edited at: 18th Dec 2018 15:34
Good idea! Now you know some details of string manipulations!
Try GetStringToken and CountStringTokens, FindString, ReplaceString in order dodge the char for char inspection, as this will be faster.

This would always return the correct format of a file str$ :

even when the file has multiple point chars in its name like "Hello.Image.Texture.PNG"


And this will return the correct name without the format:

So by "Hello.Image.Texture.PNG" it will return filename$ = "Hello.Image.Texture"

[/url]
Bored of the Rings
User Banned
Posted: 18th Dec 2018 15:48 Edited at: 18th Dec 2018 20:01
viele dank Jack, sehr gut.

Quote: "Now you know some details of string manipulations!"

yeah, since about 1982 ha

I had not looked at the token related commands, will have a play.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 18th Dec 2018 18:40 Edited at: 18th Dec 2018 18:41
Quote: "I had not looked at the token related commands"


They really simplify this kind of stuff, check out the mid() function to.

Bored of the Rings
User Banned
Posted: 18th Dec 2018 19:06
yes, I'm very familiar with mid() and other string functions in all programming languages, in fact I've used MID in the above functions. I've used tokenised functions before but not the ones in AGK. These functions were just a direct conversion from DBPro and I had converted some Ian M's matrix1 util functions to basic functions equivalients without having to use the plugin commands. The reason behind writing the functions was originally due to a DBPRo forum member requesting code to replace the IanM marix functions so they didn't have to use the plugin commands. Anyway, I digress, of course the functions will be updated in my AppGameKit project code using more efficient commands, but just wanted to get the basic code working, so the enhancements will come later.








Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others

Login to post a reply

Server time is: 2024-04-26 15:25:13
Your offset time is: 2024-04-26 15:25:13