Feature SS-186
1 vote

lasterror: optional language selection

Created by Martin Kraska on 8/2/2014 9:53 PM Last Updated by Martin Kraska on 8/3/2014 3:00 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

Currenty, lasterror cpntains the last error message in the currently chosen GUI language. If you want to test programatically for a certain error, then you have to account for the dependence on the language setting. This can be done using description strings for dummy variables, where you can specify the reference strings in whatever language you want.

To support all languages would require to find out the error string for all the languages and then to add them to the description. This is not really handy.

Proposal: provide a function lasterror(lang) where lang is a string specifying the language (as in the SMath xml files).

    Martin Kraska (Sunday, August 3, 2014 3:00 AM) #

Right, it is a feature request, not a bug report ;-)

lastErrorId seems to be a good solution. Only drawback is that in the code you would do something like "if lastErrorId=35". A set of numeric constants with verbose names e.g. Id_notDefined:=35 would come handy, but one could of course define them in the program based on observation.

Priority changed to low, the feature is not important for ordinary users. IMHO it is more important go get SMath more fool-proof than having convenience features for a few die-hards, you know what I mean.

    smath (Sunday, August 3, 2014 12:01 AM) #

Currently it is impossible to implement your proposal. The thing is SMath Studio have access to the one language only and can't retrieve required error message from another translation file. And I would say it is correct behavior which I don't wanna change.

I can offer another solution: implement lastErrorId variable or errorIdByDescription(string). It will always return integer which is obviously the same for all languages.

Will it work for you?