
-----------------------------------
evildaddy911
Wed Feb 08, 2012 11:41 am

Word processor help
-----------------------------------
What is it you are trying to achieve?
a word processing program

What is the problem you are having?
im having trouble using
var ___ : array char of boolean

Describe what you have tried to solve this problem
I cant think of anything to do about it!

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using
4.1.1

-----------------------------------
Dreadnought
Wed Feb 08, 2012 12:45 pm

Re: Word processor help
-----------------------------------
Well, I'm not sure what the issue is...

But from your code I see that there is some confusion.

If we read the documentation for The char type is an index type and can be used, for example, as subscripts, for ranges and case labels. For example, this declaration

This means that char can designate the range of all characters. But note that these are characters and not integers. (char is 8 bit, integer is 32 bit)
var __ : array char of boolean
% So we can't write
__ (1) := false
% But we can write
__ ('1') := false
% Which is the index of character 1

% This means we can't use
for i : lower (__) .. upper (__)
/* something with*/ __ (i)

% Since lower and upper produces integers

So if we can't use numbers for indices, how can we run a for loop to go through all characters?
Simple, just read the line I quoted. "The char type for ch : char
/* something with*/ __ (i)

Hope this helps.
