Character conversion

Character conversion - Poruke

#1 Objavljeno: 17. 6. 2018. 16:36:37
Brian Runagle

Brian Runagle

13 svidjanja u 27 postova.

Grupa: User

Hi

I'm looking for the equivalent to Excel ASCII functions
code("a" )=97 (space after " added to avoid a winking Smiley!)
char(97)="a"
and so on.

Does anyone know if they're hidden in a Plugin somewhere, or if there's an easy way to create them?

Many thanks
Brian
#2 Objavljeno: 17. 6. 2018. 17:15:58
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

"a"
#3 Objavljeno: 17. 6. 2018. 17:34:52
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

There are some conversion functions in Maxima.

ascii.png

ascii.sm (4,27 KiB) preuzeto 1276 put(ova).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 korisnika je svidelo ovu objavu
bdrunagle 17. 6. 2018. 18:25:00
#4 Objavljeno: 17. 6. 2018. 18:49:18
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: Super Administrator

Hello.

unicode_symb_3.PNG

Another example is available here: https://en.smath.info/forum/yaf_postsm47084_SMath-Studio-0-99-6617--12-February-2018.aspx#post47084
1 korisnika je svidelo ovu objavu
bdrunagle 18. 6. 2018. 03:45:00
#5 Objavljeno: 18. 6. 2018. 03:45:55
Brian Runagle

Brian Runagle

13 svidjanja u 27 postova.

Grupa: User

Thanks for your help gentlemen.
Brian
#6 Objavljeno: 18. 6. 2018. 11:42:50
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

Wrote

Hello.

unicode_symb_3.PNG

Another example is available here: https://en.smath.info/forum/yaf_postsm47084_SMath-Studio-0-99-6617--12-February-2018.aspx#post47084



There seems to be something special with the characters generated this way. They will be backconverted to code sequence if used in Maxima region, label region or table region.

Zeichenketten_019.png
Zeichenketten.sm (57,75 KiB) preuzeto 1207 put(ova).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#7 Objavljeno: 18. 6. 2018. 12:25:29
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

Wrote

There are some conversion functions in Maxima.

ascii.png

ascii.sm (4,27 KiB) preuzeto 1276 put(ova).



Now I know why cint("A" ) does not work. It is a translation problem from SMath to Maxima, see SS-3543.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#8 Objavljeno: 18. 6. 2018. 12:29:10
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

They are special indeed, you can see it by exposing the plain text with copy/paste... The syntax is handled at code level by the math region (like a bbcode or a markdown text)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#9 Objavljeno: 18. 6. 2018. 12:50:19
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

Wrote

They are special indeed, you can see it by exposing the plain text with copy/paste... The syntax is handled at code level by the math region (like a bbcode or a markdown text)



This is strange. I understand that the \xxxx\ markup can be convenient at input time or if the characters are generated from computed codes. But why need they to be stored this way? SMath can store and display the corresponding symbols directly.

I'd vote for an instant conversion and storage as unicode character, at least for those which actually can be displayed.
This would be closer to the paradigm "what you see is what is done".
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 korisnika je svidelo ovu objavu
frapuano 18. 6. 2018. 13:46:00
#10 Objavljeno: 18. 6. 2018. 14:06:19
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

Wrote

But why need they to be stored this way? SMath can store and display the corresponding symbols directly.



Because many characters are taken by the math syntax... +-*/.,:;<>(){}@#! (and many more)... converting the code in character may cause trouble while reading back the code.

2018-06-18 19_11_13-Window.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 korisnika je svidelo ovu objavu
frapuano 18. 6. 2018. 14:19:00
#11 Objavljeno: 19. 6. 2018. 05:19:22
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

I see the point. But as far as string literals are concerned, a conversion could be done without harm (except for string markup character).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#12 Objavljeno: 19. 6. 2018. 07:43:29
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

Since we have num2str() and str2num() I don't think it is a good idea neither when they are in a math string; better to have some functions like in maxima to do it explicitely. Apart this, the only other improvement that I might think is to allow \C\ where C is the special character instead of his code (not sure if might have side effects, though).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#13 Objavljeno: 19. 6. 2018. 12:29:06
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

Indeed, a function to generate un-encoded/un-escaped pristine special symbols for use in strings would do the job.

Then I would recommend to not conceal the encoding/escaping of symbols in strings but rather just expose the raw version. Then nobody would expect to see the pretty-printed version in custom regions.







Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#14 Objavljeno: 19. 6. 2018. 14:40:57
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: Super Administrator

Not sure if this is what you mean, but we have GlobalProfile.ReplaceUnicodeChars(text) to decode term text.
  • Novi postovi
  • Nema novih postova