Author |
Message
Pages: 1
|
||
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [337] Ziron Library Files - posted: 2011-11-04 23:33:13 right now there is no real documentation on what functions are available inside the library files and their usage... so when i get time i will post in this thread, different functions and their usage, if you want to ask about a specific function then please start a new thread in Source Help section, you will not be able to reply to this thread. ----------------------------------- ok to start off with we will look at the most recent procedure addition "strFold" which is inside the "strings.zir" library file. strFold strFold will collapse a string by x amount of characters, it takes 2 parameters, the first is the string buffer, and the second is the length you want to collapse by. Lets take a look: Code:
the output would be as so:
notice the first 10 characters are folded and the rest of the buffer has now moved to the start - making way for more appends (which we will take a look at next thread) more functions will be documented in this thread at later times/dates Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. | ||
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [345] - posted: 2011-11-05 15:19:08 Let us take a closer look at strAppend. strAppend Code:
as you see in this example, strAppend will append the string from the first null character that is in the buffer, strAppend will return true on success and false if it is unable to append the buffer. Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. | ||
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [348] - posted: 2011-11-05 15:55:48 one of the new functions added is strDup. strDup Code:
output: Code:
so here we can see that strDup will take a pointer to a string and then duplicate it into a newly allocated buffer which should be deleted with the "delete" macro when finished with. Pretty straight forward it should be noted that the second buffer will only be allocated enough space to store the actual string, in this case 10 bytes. Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. | ||
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [511] - posted: 2011-11-09 18:23:40 let us take a look this time at a couple of the functions available for searching strings for a substring. strOffset + strIndexOf Code:
From this you can see that strOffset actually returns a pointer to the position in the string that contains the found substring, but with strIndexOf, instead it returns a 0-based index of the actual position of the sub-string start. Code:
eax would equal 4 we can take a look at the 0-based indexing like so: Code:
Hope this is helpful, until next time. Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Currently Active Users: There are currently 1 user(s) online. 0 member(s) and 1 guest(s) Most users ever online was 1046, January 28, 2022, 2:08 pm. Statistics: Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51 Welcome to our newest member, yecate |