04-23-2013 06:11 AM
Bonjour,
j'ai un algorithme qui comporte la fonction to_number :
intCheckSum = to_number(substr(strNumSerie, 1, 1), '9');
j’ai trouvé cette fonction on labview, mais je n’arrive pas à le traduire on CVI.
Merci pour votre aide
04-23-2013 08:17 AM
There are a lot of conversion functions in CVI (as in every C compiler): some of them are grouped in ANSI C Library >> General utilities >> String to Arithmetic expression (functions like atoi, atof...). Alternatively you can scan number from string with sscanf (ANSI C library >> Input/Output >> Formatted Input/Output) or Scan (Formatting and I/O Library).
CVI and LabVIEW are very different: for the first one some time spent looking into libraries or checking some good C programming manual would help
04-24-2013 03:01 AM
bonjour,
il ne s'agit pas d’une simple conversion d’une chaine à un entier, la fonction to_number on le trouve en labview, PL/SQL…..
ci-joint quelques explications de cette fonction :
lien utile pour plus d'info:
http://www.dba-ora.fr/article-to_number-102614909.html
CDT
04-24-2013 11:07 AM
moumou,
1. I'm sorry but I don't speak French: I'll keep on in English and rely on automatic translations to understand your posts unless you write them in English too
2. I don't understand if you are looking for a CVI function or for an explanation of a SQL statement. While I cannot help you for the latter, I suggest you to study Scan () function from the Formatting and I/O Library, which comes plenty of explanations and examples. As an alternative in standard ANSI C language you can use sscanf (), documentation for which can be found in any C reference book
If you can provide an example of the string to extract data from, we can try suggesting you some idea.
04-24-2013 12:57 PM
Bonjour moumou,
J'ai trouvé quelques examples pour les fonctions «Scan». Regarde ces examples et dites-moi si ce n'est pas l'idée correcte.
04-24-2013 01:17 PM
...and this link works