Stringfunctions Problem

peggjones

Active Member
Licensed User
Longtime User
I have added stringfunctions to my project. Yet when I try to use a function from it it is highlighted in red and the program won't compile. Is there anything else I need to do to enable stringfunctions.

Many Thanks
 

klaus

Expert
Licensed User
Longtime User
You seem to be very impatient, please don't post the same question several times, this one is the third one.
It would have been easier to help you if you had explained exactly what you have done and what error message you get.

Did you copy the jar and xml files to the additional library folder ?
Did you check StringFunctions in the Libs tab in the IDE ?
Did you declare the library with a Dim statement ?
How do you call the function ?

In Globals you should add:
Dim sf as StringFunctions

And then you can call any function like this:
test = sf.Mid("gzijjogg", 2 4)

Best regards.
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
Thanks for that. I hadn't declared the library, didn't realise you needed to.

Sorry about multiple posts, I wasn't sure I had described the problem in enough detail or had posted in a place where people were likely to them.
 
Upvote 0

PhilipBrown

Active Member
Licensed User
Longtime User
Split Function gives strange results

The result of

Dim strSource = "-1.4985018|52.4053273|1983688820|node"
Dim strDivisor = "|"
Dim result As List
result.Initialize
Dim sf As StringFunctions
result = sf.Split(strSource, strDivisor)
Log (result)

is

(ArrayList) [, -, 1, ., 4, 9, 8, 5, 0, 1, 8, |, 5, 2, ., 4, 0, 5, 3, 2, 7, 3, |, 1, 9, 8, 3, 6, 8, 8, 8, 2, 0, |, n, o, d, e]

whereas I would have expected

(ArrayList) [-1.4985018, 52.4053273, 1983688820, node]

Has anyone tested all the other functions?
 
Upvote 0

jimcashby3

Member
Licensed User
Longtime User
WOW so is a period "." did not work, but the "\." does work, a lesson for all. This is my first post on this forum, and the help I have received after 600 hours of B4A programming in invaluable!, Thanks to all who post solutions here. I have been programming embedded systems since the i4004 was introduced. Bring back any memories? 16 pin DIP package 4 bit CPU?
 
Upvote 0
Top