Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / the order of the arguments in the function

Author
Message
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 3rd Aug 2014 13:47
Found a strange thing:


EditCourier(courier_x as integer, courier_y as integer, edit_courier as t_Courier )



and



give a different result

t_Courier is my type,
in first case - call this function is smooth, but after exit the function vanishes global array data

in second case - system halted.

function EditCourier for example



my mind is in a fog!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Aug 2014 02:57
When you change the order of the calling parameters, are you being sure to change them in both the function line itself and all places where you call the function?

Compilers tend to put calling parameters in a stack in the order they appear in the calling statement. So, if the order is different in the function declaration, you won't get what you expect.

Cheers,
Ancient Lady
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 4th Aug 2014 17:25
1. Yes.
2. Just stopped working the other function that yesterday worked fine. No change since it was not.

Just stopped working the other function that yesterday worked fine. No change since it was not.

it is important for me to understand - all the way or not. Maybe it's a "feature" of the free version outside of the period of testing?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Aug 2014 21:10
the free version is very old and full of features.
did the function exists twice?

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 5th Aug 2014 08:10
no - function one, just tried (in desperation) to put it differently.

sorry for my English.

decided to write most of the necessary programs for me in the free version to make sure that AppGameKit has everything you need.

so if you buy still full version many problems can be guaranteed to be avoided?

because I fell into despair because of these compiler errors and problems with data transmission own types and calling functions - the program has turned into a monster.
and if these problems exist in the full version of this horror!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Aug 2014 04:55
The free version is indeed very old and is known to have some issues (I don't remember what they are).

Cheers,
Ancient Lady
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Aug 2014 12:21
Your function testcour() will never work because you are trying to modify the last parameter - which is a UDT. You cannot do this in V1, because it only has call-by-value and not call-by-reference.

The way around this is to create a global array of your t_Courier type and then call your function with an index into the array.

And I'm not sure that you can DIM arrays in a UDT like that.

I don't think this is a free version issue - I think that it's a misunderstanding of what you can and cannot do with UDTs and functions.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2024-05-12 18:03:13
Your offset time is: 2024-05-12 18:03:13