eror on Isnum

eror on Isnum

Postby Silvio.Falconi » Mon Sep 30, 2024 8:35 am

FUNCTION SerializeData(aInfo)
LOCAL cResult := ""
LOCAL nItemCount := LEN(aInfo)

FOR nIndex := 1 TO nItemCount
IF ISNUM(aInfo[nIndex][2]) <---- gave me error here
cResult += aInfo[nIndex][1] + "=" + ALLTRIM(STR(aInfo[nIndex][2], 10, 0)) + CHR(10)
ELSE
cResult += aInfo[nIndex][1] + "=" + ALLTRIM(aInfo[nIndex][2]) + CHR(10)
ENDIF
NEXT

RETURN cResult


I tried also with hb_isnum()
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: eror on Isnum

Postby Antonio Linares » Mon Sep 30, 2024 8:55 am

Dear Silvio,

What error do you get ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: eror on Isnum

Postby Silvio.Falconi » Mon Sep 30, 2024 10:26 am

Now Ai corrected in
Code: Select all  Expand view

FUNCTION SerializeData(aInfo)
    LOCAL cResult := ""
    LOCAL nItemCount := LEN(aInfo)
    LOCAL cKey, cValue

    FOR nIndex := 1 TO nItemCount
        cKey := aInfo[nIndex][1]
        cValue := aInfo[nIndex][2]


        IF ValType(cKey) != "C"
            MsgAlert("Errore: La chiave non è una stringa.")
            RETURN ""
        ENDIF


        IF ValType(cValue) == "N"
            cValue := Str(cValue)  
        ELSEIF ValType(cValue) != "C"
            MsgAlert("Errore: Valore non supportato.")
            RETURN ""
        ENDIF

       
        cResult += cKey + "=" + cValue + CHR(10)
    NEXT

    RETURN cResult




and run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests