Custom Textfield Function

BlitzMax Forums/BlitzMax Beginners Area/Custom Textfield Function

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

it's actually quite simple. (and documented) make sure you read the whole "language" section under help in the ide. I probably should have entered a space though [.. s.length-1]

the "slices" section has this:

StringOrArray[StartIndex..EndIndex]
so you can do this
Local a[200]    'initialize a[] to 200 elements
a=a[50..150]    'extract middle 100 elements of a[]
a=a[..50]       'extract first 50 elements of a[]
a=a[25..]       'extract elements starting from index 25 of a[]
a=a[..]         'copy all elements of a[]
a=a[..200]      'resize a[] to 200 elements
the "strings" section has this:
Print t.length 'return length of string: 17

but I could have used the "Len" operator instead.

so
".." is the start of the string and "s.length-1" is one less than the length of the string. so with that I'm making s = to the beginning of the string to 1 less than the length.