BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EAccessViolation and arrays problems

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
vooood
Guest





PostPosted: Fri Mar 25, 2005 3:39 pm    Post subject: EAccessViolation and arrays problems Reply with quote



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





PostPosted: Fri Mar 25, 2005 4:22 pm    Post subject: Re: EAccessViolation and arrays problems Reply with quote



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





PostPosted: Fri Mar 25, 2005 5:40 pm    Post subject: Re: EAccessViolation and arrays problems Reply with quote



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





PostPosted: Fri Mar 25, 2005 6:31 pm    Post subject: Re: EAccessViolation and arrays problems Reply with quote

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





PostPosted: Sat Mar 26, 2005 9:25 am    Post subject: Re: EAccessViolation and arrays problems Reply with quote

vooood wrote:

Quote:
i do both c and delphi and you guess the rest Razz

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.