[Gambas-user] Feature request: Use key- (and index-)accessor in a With clause

2013-08-11 Thread Tobias Boege
Hi Benoit,

what bothers me from time to time is that With is *so* handy but can't be
used to access Array or Collection elements like:

With hCollection ' or hArray
  Print ["key"]  ' or Print [0]
End With

I see that this would be a syntactical problem because ["key"] and [0] may
equivalently well be recognised as inline arrays. But we have another
option, right? There is still the ! operator which is unambiguous:

With hCollection
  Print !key
End With

Should be no problem if implemented. What do you think? And while we are at
it, couldn't the ! operator at the same time get the capability to support
integers, so that the above will also work with an array:

With hArray
  Print !0
End With

Regards,
Tobi

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] GAMBAS PATH

2013-08-11 Thread Antonio Sánchez
Hi, Benoît, would reconsider the possibility to run GAMBAS from a given
path with a environment variable or another method? It would be a great
help to run programs made with older versions of GAMBAS in new systems that
do not have in its repositories older versions of GAMBAS.

It would be useful to run programs made in GAMBAS in home directory too
without root permissions.

And you could play with several versions only copying necessary files in
the work folder.

And another advantage is that you can be sure that the user will have just
the version your program need =:-)


Thanks.
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Tobias Boege
On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> Hi, Beno?t, would reconsider the possibility to run GAMBAS from a given
> path with a environment variable or another method? It would be a great
> help to run programs made with older versions of GAMBAS in new systems that
> do not have in its repositories older versions of GAMBAS.
> 
> It would be useful to run programs made in GAMBAS in home directory too
> without root permissions.
> 
> And you could play with several versions only copying necessary files in
> the work folder.
> 
> And another advantage is that you can be sure that the user will have just
> the version your program need =:-)
> 

I've hacked around in the interpreter some time ago to allow just that. I'm
not sure if I succeeded but give me some time and I'll try to dig the stuff
out again.

Regards,
Tobi

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Error in revision 5785 !

2013-08-11 Thread Ru Vuott
Hello,

updating my Gambas-3 with revision 5785  I obtained this error:



make[3]: Entering directory `/home/vuott/trunk/main'
Making all in gbc
make[4]: Entering directory `/home/vuott/trunk/main/gbc'
  CC gbc3-gbc.o
  CCLD   gbc3
/bin/bash: ../libtool: No such file or directory
make[4]: *** [gbc3] Error 127
make[4]: Leaving directory `/home/vuott/trunk/main/gbc'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/vuott/trunk/main'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/vuott/trunk/main'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vuott/trunk'
make: *** [all] Error 2



Regards
vuott


--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Tobias Boege
On Sun, 11 Aug 2013, Tobias Boege wrote:
> On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> > Hi, Beno?t, would reconsider the possibility to run GAMBAS from a given
> > path with a environment variable or another method? It would be a great
> > help to run programs made with older versions of GAMBAS in new systems that
> > do not have in its repositories older versions of GAMBAS.
> > 
> > It would be useful to run programs made in GAMBAS in home directory too
> > without root permissions.
> > 
> > And you could play with several versions only copying necessary files in
> > the work folder.
> > 
> > And another advantage is that you can be sure that the user will have just
> > the version your program need =:-)
> > 
> 
> I've hacked around in the interpreter some time ago to allow just that. I'm
> not sure if I succeeded but give me some time and I'll try to dig the stuff
> out again.
> 

Okay, the attached patch seems to work. When applied, gbx3 will first look
at the environment variable GAMBAS_ROOT. If it is defined, non-empty, the
contained path exists and is a directory, then this is taken as the Gambas
installation directory for the duration of the program. All components and
resources are located relative to that directory instead of the normal /usr
then (of course only if the /usr is not hard-coded).

My proof was a gb.ncurses project as simple as:

---
Public Sub Main()
  Window.Print("hello")
End
---

I installed the patched interpreter to /usr as usual. Then I made a simple
modification to gb.ncurses which adds ", man" to each printed string. I then
installed the modified gb.ncurses along with the interpreter like

$ make install DESTDIR=~

which creates a usr/ directory under ~/ with the alternate Gambas
installation.

$ gbx3

leads to the expected output "hello" whereas

$ GAMBAS_ROOT=~/usr gbx3

gives me "hello, man". So this works at least with components. Note that the
interpreter which runs is still the one under /usr. Only the components it
loads are from ~/usr. You may run into compatibility issues of you are not
cautious with this patch. The best thing would be to set your PATH to prefer
the interpreter which belongs to the components you want to run, i.e. in the
above case

# Also take the gbx3 from ~/usr
$ PATH=~/usr/bin:$PATH GAMBAS_ROOT=~/usr gbx3

A quick grep looks also good: the /usr path doesn't seem to hang anywhere
hardcoded:

$ grep /usr -R * --include=*.c --include=*.cpp --include=*.h 
--exclude=gb_common.h
gb.httpd/src/thttpd.h://#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin"
gb.httpd/src/thttpd.h:#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib"
gb.qt4/src/main.cpp:  && !_translator->load(QString("qt_") + 
locale, QString("/usr/lib/qt4/translations"))
gb.qt4/src/main.cpp:  && !_translator->load(QString("qt_") + 
locale, QString("/usr/share/qt4/translations")));
main/gbx/gbx_archive.c: if (!path) path = 
exist_library("/usr/bin", arch->name);
main/share/gb_component.h:#define GAMBAS_LINK_PATH  "/usr/bin/gbx" 
GAMBAS_VERSION_STRING
main/gbc/gbc_archive.c: fputs("#! /usr/bin/env gbr" GAMBAS_VERSION_STRING "\n", 
arch_file);

But seriously, I'd be cautious... How likely can a hardcoded path sneak in
and break compatibility - or something that I haven't thought of!

If you change the grep to include also components written in Gambas and the
IDE (--include=*.module --include=*.class), the you'll find quite some
hardcoded /usr paths!

Anyway, have fun with it as long as it doesn't break too much :-) I'll be
writing this up as an article for the adventurous Gambas users... The
patch should apply against the latest revision.

Regards,
Tobi
Index: main/share/gb_file_temp.h
===
--- main/share/gb_file_temp.h   (revision 5776)
+++ main/share/gb_file_temp.h   (working copy)
@@ -1130,7 +1130,21 @@
 const char *FILE_find_gambas(void)
 {
const char *path;
+   static char buf[sizeof(file_buffer)];
 
+   path = getenv("GAMBAS_ROOT");
+   if (path && *path) {
+   if (!FILE_is_dir(path)) {
+   fprintf(stderr, "WARNING: GAMBAS_ROOT defined but "
+   "not a directory. Ignoring.\n");
+   goto ignore;
+   }
+   path =  FILE_cat(path, "bin/gbx" GAMBAS_VERSION_STRING, NULL);
+   strcpy(buf, file_buffer);
+   return buf;
+   }
+ignore:
+
if (FILE_exist(GAMBAS_LINK_PATH))
{
path = FILE_readlink(GAMBAS_LINK_PATH);
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/

Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Tobias Boege
On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> Hi, Beno?t, would reconsider the possibility to run GAMBAS from a given
> path with a environment variable or another method? It would be a great
> help to run programs made with older versions of GAMBAS in new systems that
> do not have in its repositories older versions of GAMBAS.
> 
> It would be useful to run programs made in GAMBAS in home directory too
> without root permissions.
> 
> And you could play with several versions only copying necessary files in
> the work folder.
> 
> And another advantage is that you can be sure that the user will have just
> the version your program need =:-)
> 

Oh, and you may want to look at the official solution[0] Benoit supposed
earlier this year.

Regards,
Tobi

[0] http://sourceforge.net/mailarchive/message.php?msg_id=30551350

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Error in revision 5785, countermand: NO problem !

2013-08-11 Thread Ru Vuott
Hello,

I apologize for the false alarm.
No problem  ehmmm  I had omitted to launch the line:   ~ $ ./configure -C

So, No problems in revision 5785.

Excuse me.
regards
vuott

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Antonio Sánchez
Thanks for your feedback, Tobias.
If the interpreter is the same, it is not useful for the purposes mentioned
above.
If I understand correctly, your patch gets to locate your program
components in other place. But it is not useful in a system with a diferent
version of gambas than yours.

Gambas use 3 paths: /usr/bin, /usr/share/gambas and /usr/lib/gambas

It would be great if you could create a directory in a flash drive, for
example:

.../gambas342/share/
.../gambas342/lib/
.../gambas343/bin/

...copy all files and take that particular version of GAMBAS anywhere and
with a GB_PATH=".../gambas342/" before your program, it know where look for
GAMBAS interpreter. If you exclude examples, you'd have a portable version
of gambas below 15Mb. And you have the security your program runs
everywhere and for a long time.
Now, the policy for programs made with GAMBAS is a sad "upgrade or die" and
it is a real shame you can't run programs because the version of your
distribution is too low or too high for your program.





2013/8/11 Tobias Boege 

> On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> > Hi, Beno?t, would reconsider the possibility to run GAMBAS from a given
> > path with a environment variable or another method? It would be a great
> > help to run programs made with older versions of GAMBAS in new systems
> that
> > do not have in its repositories older versions of GAMBAS.
> >
> > It would be useful to run programs made in GAMBAS in home directory too
> > without root permissions.
> >
> > And you could play with several versions only copying necessary files in
> > the work folder.
> >
> > And another advantage is that you can be sure that the user will have
> just
> > the version your program need =:-)
> >
>
> Oh, and you may want to look at the official solution[0] Benoit supposed
> earlier this year.
>
> Regards,
> Tobi
>
> [0] http://sourceforge.net/mailarchive/message.php?msg_id=30551350
>
>
> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Tobias Boege
On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> Thanks for your feedback, Tobias.
> If the interpreter is the same, it is not useful for the purposes mentioned
> above.
> If I understand correctly, your patch gets to locate your program
> components in other place. But it is not useful in a system with a diferent
> version of gambas than yours.
> 
> Gambas use 3 paths: /usr/bin, /usr/share/gambas and /usr/lib/gambas
> 
> It would be great if you could create a directory in a flash drive, for
> example:
> 
> .../gambas342/share/
> .../gambas342/lib/
> .../gambas343/bin/
> 
> ...copy all files and take that particular version of GAMBAS anywhere and
> with a GB_PATH=".../gambas342/" before your program, it know where look for
> GAMBAS interpreter. If you exclude examples, you'd have a portable version
> of gambas below 15Mb. And you have the security your program runs
> everywhere and for a long time.
> Now, the policy for programs made with GAMBAS is a sad "upgrade or die" and
> it is a real shame you can't run programs because the version of your
> distribution is too low or too high for your program.
> 

If you apply that patch and export GAMBAS_ROOT=.../gambas342/, your gbx3
will not use /usr but .../gambas342 instead to search for its stuff (most of
its stuff). I think this is what you wanted, no?

As I said, I don't think that you can create a well-behaving portable Gambas
distribution as there are some hardcoded uses of the /usr prefix in the
source code of at least the IDE. These portions will likely fail when you
execute your portable Gambas in an environment where no normal Gambas is
installed.

Regards,
Tobi

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Antonio Sánchez
I'm going to try your patch. I want to know what happens if you don't have
installed gambas in the system and you use only your patched version in
other places.



 2013/8/11 Tobias Boege 

> On Sun, 11 Aug 2013, Antonio S?nchez wrote:
> > Thanks for your feedback, Tobias.
> > If the interpreter is the same, it is not useful for the purposes
> mentioned
> > above.
> > If I understand correctly, your patch gets to locate your program
> > components in other place. But it is not useful in a system with a
> diferent
> > version of gambas than yours.
> >
> > Gambas use 3 paths: /usr/bin, /usr/share/gambas and /usr/lib/gambas
> >
> > It would be great if you could create a directory in a flash drive, for
> > example:
> >
> > .../gambas342/share/
> > .../gambas342/lib/
> > .../gambas343/bin/
> >
> > ...copy all files and take that particular version of GAMBAS anywhere and
> > with a GB_PATH=".../gambas342/" before your program, it know where look
> for
> > GAMBAS interpreter. If you exclude examples, you'd have a portable
> version
> > of gambas below 15Mb. And you have the security your program runs
> > everywhere and for a long time.
> > Now, the policy for programs made with GAMBAS is a sad "upgrade or die"
> and
> > it is a real shame you can't run programs because the version of your
> > distribution is too low or too high for your program.
> >
>
> If you apply that patch and export GAMBAS_ROOT=.../gambas342/, your gbx3
> will not use /usr but .../gambas342 instead to search for its stuff (most
> of
> its stuff). I think this is what you wanted, no?
>
> As I said, I don't think that you can create a well-behaving portable
> Gambas
> distribution as there are some hardcoded uses of the /usr prefix in the
> source code of at least the IDE. These portions will likely fail when you
> execute your portable Gambas in an environment where no normal Gambas is
> installed.
>
> Regards,
> Tobi
>
>
> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] How to share one datasource across two forms?

2013-08-11 Thread Marty
Hello,

First let me say thank you to all those who have answered my past posts.

As I get deeper into programming databases with Gambas, more questions 
come out. I have two forms which show data from the same table. The data 
is split up so that the user interface is less confusing. My first 
question is how can I show the data on form 2 when the datasource is on 
form 1?

I'd like to use a datacombo box to provide input to a field but, get the 
list from another table. Is this possible?

One more. I also need a data aware checkbox. I want to save the logical 
value of the checkbox to the datasource. Any suggestions?

I'm used to MS VB and data access there is quite different. In many 
respects Gambas has a much simpler approach.

Thanks,
Marty

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] GAMBAS PATH

2013-08-11 Thread Jesus
El 11/08/13 14:45, Antonio Sánchez escribió:
> Hi, Benoît, would reconsider the possibility to run GAMBAS from a given
> path with a environment variable or another method? It would be a great
> help to run programs made with older versions of GAMBAS in new systems that
> do not have in its repositories older versions of GAMBAS.
>
> It would be useful to run programs made in GAMBAS in home directory too
> without root permissions.
>
> And you could play with several versions only copying necessary files in
> the work folder.
>
> And another advantage is that you can be sure that the user will have just
> the version your program need =:-)
>
>
> Thanks.


Some time ago, I was playing with gambas2 and the GB_DIR environment 
variable. I was able to start my programs from anywhere in the mounted 
storage units.

However, since then, I haven't used GB_DIR anymore, but I guess Benoit 
could explain here if this is still a valid option for the purpose.

In the meantime, Antonio, you could check some threads in the Spanish 
forum, perhaps that will give you some clues.

http://www.gambas-es.org/viewtopic.php?p=1388#p1388

Regards
-- 
Jesus Guardon

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] segfault with insanely large array of structures

2013-08-11 Thread Kevin Fishburne
I know this code is horrible (it will be changed), but the following 
declarations and procedure raise a signal 11 and populate some of the 
array properties with non-zero values:


' Plan structures and array (server).
Public Struct PlanBlockStructure ' Structure containing individual block 
data.

  Created As Boolean  ' If block PWO has already been created.
  Skin As Short   ' Block skin.
  HeightCurrent As Single ' Current height in feet of block.
  HeightTarget As Single  ' Target height in feet of block.
  Grading As Boolean  ' If grading is required.
  WorldX As Integer   ' Hard coordinates of block once construction 
has been initiated.
  WorldY As Integer   ' Hard coordinates of block once construction 
has been initiated.

End Struct
Public Struct PlanStructure ' Structure containing individual plan data.
  Block[300, 300] As Struct PlanBlockStructure
  Stage As Byte   ' Current build stage (0 = design, 1 = clear and 
grade, 2 = wall construction, 3 = roofing construction, 4 = flooring 
construction, 5 = finished/maintenance).

  CurrentX As Short   ' Current position in block array.
  CurrentY As Short   ' Current position in block array.
  GradeTo As Single   ' Elevation in feet to grade landscape to.
  CenterX As Integer  ' Build site center coordinate.
  CenterY As Integer  ' Build site center coordinate.
End Struct
Public Plan[2000] As Struct PlanStructure ' Architecutral plans.

' Plan maintenance (server).
Public LastTime As Single = Timer ' Time last architectural plan was 
maintained.


Public Sub Plan_Maintenance()

  ' Maintain architectural plans.

  ' General declarations.
  Dim Index As Short' Plan to maintain.
  Dim Elevation As Integer  ' Elevation of current tile in inches.
  Dim Excavation As Integer ' Number of inches to excavate to match 
specified grade.


  ' Check if plans are due to be updated.
  If Timer < (LastTime + 0.1) Then Return
  LastTime = Timer

  ' Cycle through plans.
  For Index = 0 To 1999

' Check if plan stage requires maintenance.
If Plan[Index].Stage <> 0 Then

  ' Check plan stage.
  Select Case Plan[Index].Stage

' Clear and grade.
Case 1
  ' Advance position in plan to next position requiring grading.
  Do Until Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].Grading

' Increment X position in grid.
Plan[Index].CurrentX += 1
' Check if X position needs wrapping.
If Plan[Index].CurrentX >= 300 Then
  ' Wrap X position.
  Plan[Index].CurrentX = 0
  ' Increment Y position in grid.
  Plan[Index].CurrentY += 1
  ' Check if Y position needs wrapping.
  If Plan[Index].CurrentY >= 300 Then
' Advance to next stage.
Plan[Index].Stage += 1
  Endif
Endif
  Loop
  ' Clear snow and vegetation depths.
Tiles.Depth_Assign_Snow(Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldX, Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldY, 0)
Tiles.Depth_Assign_Vegetation(Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldX, Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldY, 0)

  ' Calculate hard elevation.
  Elevation = 
Tiles.Depth_Get_Hard(Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldX, Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldY)

  ' Calculate excavation amount.
  Excavation = Elevation - Plan[Index].GradeTo * 12
  ' Grade landscape.
  Tiles.Excavate(Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldX, Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].WorldY, Excavation, True)

  ' Mark block as graded.
  Plan[Index].Block[Plan[Index].CurrentX, 
Plan[Index].CurrentY].Grading = False


' Wall construction.
Case 2

' Roofing construction.
Case 3

' Flooring construction.
Case 4

' Finished/maintenance.
Case 5


  End Select

Endif

  Next

End

' END OF CODE

I attached the above code for better readability. It's notable that if 
the For...Next loop only addresses the first few indices of Plan[] that 
it works, which leads me to believe the array of structures is 
improperly allocated, probably due to its ridiculous size. The fact that 
some of the array property values read as non-zero before being assigned 
makes me think their pointers are pointing to out-of-process RAM being 
used by something else entirely. I suck at low-level programming so I'm 
just speculating ignorantly, sorry.


--
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271

' Plan structures and array (server).
Public Struct PlanBlockStructure ' Structure containing ind