PDA

View Full Version : September is the school time



RobertoBianchi
01-09-2006, 18:02
After others European countries now also in Italy begins the school.
Here as ThinBASIC demonstrates to be an interesting instrument for teaching offering a simple language, powerful and NATURAL for the instruction of computer science also to the students of the primary cycle.
In fact often the difficulty to use programming languages with young children often is tied to the language that forces the students to use the programming language keywords and intrinsic functions in English.
That is unnatural because the attention and the efforts of the child are focused too much on one's strange word rather than on programming logic.

Here we see how use ThinBASIC in order to program in more NATURAL way.

In the first place it is necessary to create inclusion rows where the words key and the functions come more redefined in way adapted to the own language:

There is a general include file

ALIAS uses AS usa
ALIAS dim AS variabile
ALIAS string AS stringa

USA "Console"
#include "ModuloConsoleItaliano.inc"

ALIAS as AS come

And a module specific include file

ALIAS Console_ReadLine AS leggi_riga
ALIAS Console_WriteLine AS scrivi_riga
ALIAS Console_Cls AS pulisci_schermo


After that it is possible to program in more natural way for the student

#include "Italiano.inc"

VARIABILE nome COME STRINGA

SCRIVI_RIGA("Come ti chiami?")
nome = LEGGI_RIGA
PULISCI_SCHERMO
SCRIVI_RIGA("--------------------------------------")
SCRIVI_RIGA(" Ciao " & nome & " benvenuto a scuola!")
SCRIVI_RIGA("--------------------------------------")


For thoroughness it follows the script in the language standard (English)

USES "Console"

DIM nome AS STRING

Console_WriteLine("Come ti chiami?")
nome = Console_ReadLine()
Console_Cls
Console_WriteLine("--------------------------------------")
Console_WriteLine(" Ciao " & nome & " benvenuto a scuola!")
Console_WriteLine("--------------------------------------")


Regards,
Roberto

ErosOlmi
01-09-2006, 18:57
In other words, you can efficiently use the ALIAS functionality to add your own mother language "aliased" keywords replacing (well, not replacing but putting them side-by-side) internal thinBasic keywords.

So,

ALIAS Console_ReadLine AS Leggi_Riga
will add the new keyword Leggi_Riga acting exactly the same as standard Console_ReadLine.

This is just a little Italian-English example applicable to most of the other languages.

Regards
Eros

Petr Schreiber
01-09-2006, 22:53
Hi,

very good idea indeed. I think for learning it is very good, because the child/student can get the idea of "what's going on" faster ( Parsing speed of native language is faster than english until youre from english speaking country :) ).

I just realized I can even use national characters to set the new aliases, although it seems to be illegal to set alias with first character national.

Petr

ErosOlmi
02-09-2006, 00:02
Petr,

can you conform ascii code for local chars? Are they from ascii 192 to 255?
I will change parser in order to include them.

Ciao
Eros

Petr Schreiber
02-09-2006, 20:32
Hi Eros,

thanks, but attached dll does not work on this. For example "mild s" has code 154, "mild z" 158.
But it is not necessary to change core for this! In our country there is long tradition of writing without punctuacion ( from eldest DOS stone age times ), so in that way it works perfectly.

Thanks a lot,
Petr

ErosOlmi
03-09-2006, 11:47
OK, fine, but we would like national char been valid for keywords as far as this will not "infect" thinCore functionalities ;)

Does the new attached version works for you now?

Thanks a lot
Eros

RobertoBianchi
03-09-2006, 12:00
Hi Eros,

why not use ascii code from 32 to 255?

Ciao
Roberto

ErosOlmi
03-09-2006, 12:05
Roberto,

that's sure the right solution but I have to check priority in parsing in order to avoid number to become alphawords and the other way round. I will have a look but attached version, if confirmed by Petr, should fix the problem.

Ciao
Eros

RobertoBianchi
03-09-2006, 12:25
I agree, token acknowledgment must have the highest priority, also the use of some characters like space and punctuation should be prohibited.

Ciao

Petr Schreiber
03-09-2006, 16:04
Hi,

even the latest core doesn't work :(
ASC statement confused me, because the "mild s" is reported as code 154, but inserting char using ALT+154 does other character. I must type ALT+0154 to get "mild s". But as ASC can return number, to display it I should use FORMAT$ with mask "0000". Sorry for previous confusing info. Czech language is covered in Windows 1250 coding, if I'm not wrong.

Hope this helps.

Bye and thanks,
Petr

RobertoBianchi
04-09-2006, 09:17
Hi Petr,

in order to find the code of "mild s" you could use ThinAIR's characters map.

Ciao,
Roberto

Petr Schreiber
04-09-2006, 09:32
Hi Roberto,

thanks for the tip, but strange thing happened.
When I startup charmap, it shows codes up to 099 and the rest of characters ( beginning with "d" ) does not display the code ?!

Any ideas ?

If I try windows built-in charmap, I get Alt+0138 for "UCASE mild s", but for "LCASE mild s" I get message "press mild s on keyboard" :D. I was working with "Courier New CE" font.

Bye,
Petr

RobertoBianchi
04-09-2006, 13:12
Hi Petr,

changed ThinAIR's char map for display all character code.

If you got the "press mild s on keyboard" message on the windows charmap.exe status bar may be you are using unicode, not ascii code.

Ciao,
Roberto

Petr Schreiber
04-09-2006, 14:03
Hi Roberto,

hard to say what I'm using :), but I'm quite suspicious that unicode support is not very big on Windows Millenium ???

Thanks,
Petr