Menu

Non-ASCII garbage does not result in a syntax error.

Anonymous
2017-01-12
2017-01-12
  • Anonymous

    Anonymous - 2017-01-12

    It seems you can type basically any string in the BASIC prompt, as long as it doesn't contain an ASCII character. Even if it doesn't make syntactical sense, PC-BASIC will not throw a "syntax error" message if this happens. As an example, using --codepage=ruscii:

    фыва                                                                            
    Ok                                                                              
    abcфыва                                                                         
    Syntax error                                                                    
    Ok                                                                              
    bqqwdqd                                                                         
    Syntax error                                                                    
    Ok                                                                              
    фыв 142                                                                         
    Syntax error                                                                    
    Ok                                                                              
    фыв abc                                                                         
    Syntax error                                                                    
    Ok
    

    As you can see, after the first string is entered, PC-BASIC merely responds with "Ok", even though the entered text is not a valid BASIC statement.

     
  • Rob Hagemans

    Rob Hagemans - 2017-01-12

    Hi, thanks for reporting - this is the correct behaviour, though. Only printable ASCII characters (with values between 32 and 127) lead to Syntax Error in GW-BASIC. The graphical characters below 32 and the codepage characters above 128 are simply ignored if entered by themselves on the console, regardless of whether or not it is a valid statement. Since the Cycillic characters you type are mapped to character codes >128, they do not lead to Syntax Error.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.