FlexPro
HistoryBase
Ingénierie
Formation
Téléchargements
Assistance FlexPro
Connaissance
Communauté
À propos de nous
Références
Emplois
Contact général
Liste des revendeurs
Assistance FlexPro
FR
DE
EN
Porte-plaquette
Produits et solutions
Support et téléchargements
Entreprise
Magazine
Contact
Langue
MyWeisang

Paramètres du compte.

Topic

Avoiding errors messages in Cell tables

Page d'accueil ' Communauté ' FPScript ' Éviter les messages d'erreur dans les tableaux de cellules

Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Auteur
    Messages
  • #33578
    HerveM1234
    Participant

    Hi,

    I’m filling a Cell Table using FPscript.
    The cells content is :
    [code]%.0F{MK[0]}s
    %.0F{MK[1]}s
    %.0F{MK[2]}s[/code]
    Every things work perfect is MK[i] exists, if not I have this message in the cell :
    [code]%.0F(Wrong value in index operation.

    The index value used lies outside of the valid value range for the data set to be indexed.)s[/code] instead of empty cell or N/A for example.
    Is there a way to change this behaviour. If value does not exist I would like nothing in the cell.

    Thanks in advance

    #33580
    HerveM1234
    Participant

    Hi,

    I’m filling a Cell Table using FPscript.
    The cells content is :
    [code]%.0F{MK[0]}s
    %.0F{MK[1]}s
    %.0F{MK[2]}s[/code]
    Every things work perfect is MK[i] exists, if not I have this message in the cell :
    [code]%.0F(Wrong value in index operation.

    The index value used lies outside of the valid value range for the data set to be indexed.)s[/code] instead of empty cell or N/A for example.
    Is there a way to change this behaviour. If value does not exist I would like nothing in the cell.

    Thanks in advance

    #33579
    Bernhard Kantz
    Participant

    There are two possible solutions: Ensure the required size of the dataset, e.g. by creating it with the needed number of void entries and setting only the values computed. This leads to cell table contents like ? s.
    Another solution is to back the original dataset by a fixed size string dataset holding the actual cell table entries. In the present case, the following FPScript fomula does the formatting and handles the non-existing data elements.

    [code]
    Dim sRes = “N/A” # 3 // “empty” cell

    For Each Row i In sRes Do
    Try
    sRes[i] = Format(“%.0F s”, MK[i])
    Catch ignore
    End
    End

    sRes
    [/code]

    If named [b]strMK[/b] one can change the cells content to
    [b]%%%[/b]
    avoiding the error message since the genereted string dataset has the required length.

Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Vous devez être connecté pour répondre à ce sujet.