Search code examples
stringcharbasic

ATEASY software development environment formatted string


Lets say i have a char[100] which is formatted like this: “%d,%d,%d,%.2f,%.2f”.

What is the best way in ATEASY to get all 5 varible values? ( long,long,long,float, float).

I wanted to work with Split(sStr,",") but it only works with String type.


Solution

  • I used sscanf(const char *str, const char *format, ...) func in this form:

    sscanf(str, "%d, %d, %d, %lf, %lf", lLong1, lLong2, lLong3, dDouble1, dDouble2)
    

    In order to use this function you must add MSVCRT library to your libraries

    Which is in:

    C:\Windows\system32\msvcrt.dll.