Undefined

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

    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álezIván González
    Moderator
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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álezIván González
10 months, 3 weeks ago.

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