FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour eror on Isnum
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
eror on Isnum
Posted: Mon Sep 30, 2024 08: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 March-April 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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: eror on Isnum
Posted: Mon Sep 30, 2024 08:55 AM

Dear Silvio,

What error do you get ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: eror on Isnum
Posted: Mon Sep 30, 2024 10:26 AM
Now Ai corrected in
Code (fw): Select all Collapse
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 March-April 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

Continue the discussion