Undefined

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #253106 quote
    Bernard13
    Participant
    Average

    Bonjour,
    Indépendamment de l’historique, existe-t-il une instruction permettant de traiter un calcul et affichage n/d ?
    Undefined ne fonctionne pas
    IF x <> Undefined THEN
    faire ceci
    ELSE
    faire cela
    ENDIF
    Merci d’avance.

    #253107 quote
    Iván González
    Moderator
    Master

    Dans Probuilder, undefined est une valeur “non définie” destinée à ne pas être dessinée/affichée (elle apparaît comme n/a) et à “couper” les chaînes de calcul lorsqu’il n’y a pas encore de valeur valide. Il ne peut pas être comparé directement avec = ou <> (comme avec NaN dans d’autres langages) : toute comparaison avec undefined renvoie faux.
    C’est pourquoi votre IF x = undefined entre dans l’ELSE et vous voyez y = 2 et x = n/a.
    Astuce sûre : un undefined n’est pas égal à lui-même. Utilisez-le ainsi :

    once x=undefined
    
    if x<>x then
       y=1 // x is undefined
    else
       y=2 // x is defined
    endif
    
    return y
    
    Bernard13 thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Undefined


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Bernard13 @bernard13 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
3 months, 1 week ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/28/2025
Status: Active
Attachments: No files
Logo Logo
Loading...