 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
vooood Guest
|
Posted: Fri Mar 25, 2005 3:39 pm Post subject: EAccessViolation and arrays problems |
|
|
this is the type
----------------
TSpellsTag = class
mults: array[1..32] of shortstring;
times, spell, spellbook: array[1..256] of shortstring;
end;
var aspells: TSpellsTag
(aspells is a global var)
this is the first usage
-----------------------
aspells.spell[order]:= copy( line, 1, idx );
order is 100% = 1, line is a string(nonempty), and idx is a nonzero
number (greater than 0 because this line is called after idx is more than 0)
this is the error
-----------------
Project spellconv.exe raised exception class EAccessViolation with
message 'Access violation at address 0040449E in module 'spellconv.exe'.
Write of address 00012004'. Process stopped. Use Step or Run to continue.
i get the same error even if i try something like aspells.spell[1]:= 'shit';
i just can't get what's wrong.. please help me.. i use delphi 6 with
winxp sp2..
thanx
vooood
|
|
| Back to top |
|
 |
Lukas Gradl Guest
|
Posted: Fri Mar 25, 2005 4:22 pm Post subject: Re: EAccessViolation and arrays problems |
|
|
Voood, (that's a name in your country?)
On Fri, 25 Mar 2005 16:39:25 +0100, vooood <vooood (AT) IHATESPAMgmail (DOT) com>
wrote:
| Quote: | this is the type
----------------
TSpellsTag = class
|
Why =class?
Try
TSpellsTag = record
instead and it should work.
| Quote: | mults: array[1..32] of shortstring;
times, spell, spellbook: array[1..256] of shortstring;
end;
|
regards
Lukas
|
|
| Back to top |
|
 |
Rob Kennedy Guest
|
Posted: Fri Mar 25, 2005 5:40 pm Post subject: Re: EAccessViolation and arrays problems |
|
|
vooood wrote:
| Quote: | Project spellconv.exe raised exception class EAccessViolation with
message 'Access violation at address 0040449E in module 'spellconv.exe'.
Write of address 00012004'. Process stopped. Use Step or Run to continue.
|
Show us the point in your code where you call TSpellsTag.Create.
| Quote: | i get the same error even if i try something like aspells.spell[1]:=
'shit';
|
That error is because Delphi doesn't like profanity. Keep it to yourself.
--
Rob
|
|
| Back to top |
|
 |
vooood Guest
|
Posted: Fri Mar 25, 2005 6:31 pm Post subject: Re: EAccessViolation and arrays problems |
|
|
Lukas Gradl wrote:
| Quote: | Voood, (that's a name in your country?)
On Fri, 25 Mar 2005 16:39:25 +0100, vooood
wrote:
this is the type
----------------
TSpellsTag = class
Why =class?
Try
TSpellsTag = record
instead and it should work.
|
hahaha.. what idiot i am :)
i do both c and delphi and you guess the rest :P
thanx
|
|
| Back to top |
|
 |
DrDiettrich Guest
|
Posted: Sat Mar 26, 2005 9:25 am Post subject: Re: EAccessViolation and arrays problems |
|
|
vooood wrote:
| Quote: | i do both c and delphi and you guess the rest
|
For C++ classes you can use Record or Object types in Delphi, instead of
Class.
Such an Object is a record with attached methods, perfectly usable as
(local) variables.
DoDi
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|