pascal ascii characters

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal ascii characters

Postby charles » Sun Jun 24, 2007 12:06 pm

ok short and brief...
how does one access the ascii characters through the keyboard...
to be more precise is there a keyboard short cut or key combination which allows me to type directly into the editor of pascal the ascii characters for the decimal values i type?

thanks charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Sun Jun 24, 2007 6:03 pm

Depending on the TOS version, one can hold the ALTernate key down and type an ASCII value on the numeric keypad to produce any character.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal extended special characters

Postby charles » Sun Jun 24, 2007 7:07 pm

nope not in this case, how , i don't know , i know how within gfa and omikron but does not respond to pascal...
charles???????????
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Sun Jun 24, 2007 7:58 pm

Perhaps do it in the code:
string[2]=65 ;"A"

or something like that, not used Pascal for ages :)

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal

Postby charles » Sun Jun 24, 2007 9:17 pm

well i would but that would mean i have to do alot of extra re writing of this old code i am porting over to pascal from gfa basic.

infact i don't think that will work due to complications of declaring all variables but it might work basically i i use one string within a if statemnet that decides its out come.
if x=factor
a$="my string"
elseifx =factor1
a$="my variation of string"
elseuif=factor2
a$="my var#2"
elseif factor3
a$="myvar#3"
endif
then i move this string to midiws ()

so afew....or alot of the conditions within the if/then loop, once met,
also decide the contents of the string ..which is more than one character
so as you can see a string is made for each of the conditions ,depending on which factor has been indicated...its just darn simplistic to have a string prepared a$=" x x x x" then to have say:
string[0]:=144;
string[1]:=65;
string[2]:=40;
but i will not argue , if this is what i must do , i will do.
although your example lonny has a type difference conflict.
string is characters.......and you.=65 is decimal/variable/integer.

charles
i guess i could bmove the contents of the address from lpeek address
if i use integer array but not streessing to hard right now.
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Sun Jun 24, 2007 11:59 pm

It was over 10 years ago I messed with Pascal and I cannot remember how the string declarations should be. :)

Once you have it ported I'd be curious to know if it's actually faster than compiled GFA.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal

Postby charles » Mon Jun 25, 2007 12:10 am

yep you got it lonny , but the trouble is now d-frig narrays and lengths of strings are restrained...
how do you suppose i get 9000 integer bytes in an array?

well struggle is all i seem to do .. havin fun yet?

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
daeghnao
Captain Atari
Captain Atari
Posts: 479
Joined: Wed Oct 27, 2004 12:41 pm
Location: York, UK
Contact:

Postby daeghnao » Mon Jun 25, 2007 9:37 am

I would expect something along these lines to work?

Code: Select all

var
  command_one: packed array[0..2] of char = ( char(1), char(40), char(23) );
  command_two: packed array[0..3] of char = ( char(1), char(80), char(2), char(12) );


I haven't done any Pascal for years, though, so apologies if I've polluted that with Ada.

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Postby PaulB » Mon Jun 25, 2007 9:47 am

Here is a turorial page on Turbo Pascal arrays (for Windows) but the syntax should be the same or similar http://library.thinkquest.org/27297/

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal strings

Postby charles » Mon Jun 25, 2007 10:42 am

ahh i'm not that dumb ,
strings of packed or not i understand,
but how does someone set up a couple arrays
which contain 0..9000 elements
if i use more than one array with this amount ,
my compiller says array to large ..or even if i divide and share 9000 amongst two arrays 4000 and 5000 the compiller runs and instantlly errors 'not enopugh memory to run program....

touch stuff ,difficult learning all aspects of programming .

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
daeghnao
Captain Atari
Captain Atari
Posts: 479
Joined: Wed Oct 27, 2004 12:41 pm
Location: York, UK
Contact:

Postby daeghnao » Mon Jun 25, 2007 1:58 pm

I wonder if it's trying to allocate all of the array elements onto the stack? That would explain having a small amount of memory to work with. Is it a fixed amount of memory that you can allocate in this way? Something like 4K or 8K? You may end up having to allocate dynamically and load the data in from a data file, or maybe there's something you can do with constant declarations and pointers.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

my and my big problem

Postby charles » Mon Jun 25, 2007 10:34 pm

hmmmmm yes lots of constants,lots var ,,,and lets check....hmmm..
only a stack compiller option =>
$m: stack =200 kbyte

has this been ample information?

i give up ,
now i am sticking all const into applicable procedures,
i have lots of units loaded too!!
additionally this is very new territory to me pascal , what need i do?

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

hey i,ve found some memory

Postby charles » Mon Jun 25, 2007 11:11 pm

please see attached picture, at the bottom where it states:
memory for program

initially was set to 100 wow 100!

i changed to 99999 but it has been cliped to 16384.
is this gonna do forever?

charles
You do not have the required permissions to view the files attached to this post.
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Tue Jun 26, 2007 4:15 am

Your emulator could be setup wrong, to low of ram.
Or to high, some old programs get confused if the ram is set to big.

It looks like the pascal editor consumes all but 16k. Alternate method is to just terminate the editor and test your compiled code from the desktop.

User avatar
daeghnao
Captain Atari
Captain Atari
Posts: 479
Joined: Wed Oct 27, 2004 12:41 pm
Location: York, UK
Contact:

Postby daeghnao » Tue Jun 26, 2007 10:43 am

Ah, right, so my stack theory is likely not the case. I'd definitely go playing with other memory settings if you can, see what's taking it all up. I remember devpac lets you set buffer size to use in the editor, maybe you can do the same with this?

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Postby Nyh » Tue Jun 26, 2007 1:35 pm

lp wrote:It looks like the pascal editor consumes all but 16k. Alternate method is to just terminate the editor and test your compiled code from the desktop.

Maybe read again? It says 16384 KILO Byte, or 16 Mb. It is more than a ST will ever have. Even the original setting of 100 kB was enough.

Hans Wessels

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Tue Jun 26, 2007 4:47 pm

Nyh wrote:
lp wrote:It looks like the pascal editor consumes all but 16k. Alternate method is to just terminate the editor and test your compiled code from the desktop.

Maybe read again? It says 16384 KILO Byte, or 16 Mb. It is more than a ST will ever have. Even the original setting of 100 kB was enough.

Hans Wessels


Appears so, lol Like I also said, some old programs get rather confused about huge memory sizes. He should set it to some reasonable amount like that of a 1040ST or such and see if it works better. I have had this problem with Hatari and lowering the ram to better mimic an old system caused some apps to work.

He's working with very old software, maybe the startup code in the library does not check free memory correctly. Hard to say. I really think "C" would of been a better choice at this point. :D

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Postby PaulB » Tue Jun 26, 2007 6:46 pm

The fact is that Pascal is a fine language but it's well and truly outdated. GFA was based upon the Pascal language which means that GFA was after and (probably) better than Pascal.

I seem to remember that tons of midi apps were programmed in GFA. GFA wasn't exactly great for fps stuff but when it came to apps of any sort GFA was perfect. Why bother reverting to an ancient languge that can't do as much?

User avatar
Desty
Atari God
Atari God
Posts: 1970
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Postby Desty » Tue Jun 26, 2007 9:06 pm

I'd definitely recommend GFA as a language to learn as a novice. Worked for me!
tá'n poc ar buile!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

pascal

Postby charles » Tue Jun 26, 2007 10:06 pm

sorry guys , i am no novice...
i use gfa for five years , i have great user interactions with it and wish to spend some time learning a 'staple' language like c ,assembler or pascal..
only to expand the use of variable types , arrays and ,program flow control. type declaration exchange. byte to integer ,,,int 2 string ...high ..low ,,you know ...mr perfect the computer programmer...

a well written program in gfa will function faster than one slopply written in c , so i set forth to explore how other big languages dominate
or constraint my crampy little basic (s)....
i plan to gain some techinque and further the development of my computer language .

charles
i just chose the first pascal i found , maybe another will change my situation, high speed pascal is very easy to learn though.....
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Postby PaulB » Tue Jun 26, 2007 10:19 pm

That's good Charles that you want to broaden your knowledge of programming. However as I said previously Pascal is all but a dead language. Why not try C or Assembly language which are far more efficient and you can do so much more. C, being a high level language would probably be easier to learn but personally I would recommend Assembler because it's so much more sexy. Once you get the basics of 68000 assembler it becomes addictive and you'll want to learn more and more and more. All the fastest programs on the ST are written in assembly because it's the next best thing to pure machine code that the computer directly understands. It's a hard task and you have to have a lot of reference books around but in the end it's worth it.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2565
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

ok pascal

Postby charles » Wed Jun 27, 2007 2:47 am

ok pascal can be frustrating especially when the urge to jump ahead comes along.....
so this is what i pulled up from the examples i found,,
,its a command which appears to "over ride" the compillers
manual settings, so i may physically crank stuff way up without my screen saying
...can not test program not enough memory.....
maybe this helps

charles

code is:

{$R-,S-,D-}
{$M 4,1,1,20} ={4KBYTE STACK , 1KBYTE HEAP, UNUSED, UNUSED}

COOL ?
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2454
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Wed Jun 27, 2007 4:38 am

I have to agree with Paul, assembler is oh so sexy. 8)

With some bits of assembler interfaced into GFA, most problems can be solved. This is the approach I use. My GFA editor is written in GFA with 15 or so assembler routines added where I need maximum speed.

PureC could be the answer, it works even on my Hades.

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Postby Nyh » Wed Jun 27, 2007 10:58 am

PaulB wrote:The fact is that Pascal is a fine language but it's well and truly outdated. GFA was based upon the Pascal language which means that GFA was after and (probably) better than Pascal.

I beg to differ.

Pascal was written as a language for learning programming. For it's purpose it was perfect. Very strict syntax and type checking.

Gfa is primary a Basic dialect. It is not as clean as Pascal. You can write clean and structured programs in Gfa Basic but it is too easy to make a big mess of your programs.

I think you should only use Pascal for learning how to program in a programming course at a pretty high level. I think Charles is still lacking fundamental knowledge about programming. He is very enthousiast but his questions makes clear to me there are big fundamental gaps in his knowledge. Switching programming languages won't help a lot and may even confuse him more.

Maybe some assembly programming will help him to understand how the 68000 shuffles bits, bytes, words and longs around to make things happen.

Hans Wessels

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: ok pascal

Postby Nyh » Wed Jun 27, 2007 11:01 am

charles wrote:{$M 4,1,1,20} ={4KBYTE STACK , 1KBYTE HEAP, UNUSED, UNUSED}

Well, maybe you should use 16 kB for the stack and something like 64kB for the heap. A 1 kB heap can be a bit small, depending on what you are trying to do and how the compiler uses the heap.

Hans Wessels


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests