Page 1 of 1

Shared With and automatic With in ForEach

Posted: Sun Oct 08, 2006 1:58 pm
by Trond

Code: Select all

Procedure Apple()
  Shared With Banana() Fruits
  Fruits = 5    ; This is s_Banana.v_Fruits
EndProcedure

Procedure Orange()
  Shared With Banana() Fruits
  Fruits = 10   ; This is s_Banana.v_Fruits
EndProcedure

Procedure Banana()
  Static Fruits
  Fruits = 1    ; This is s_Banana.v_Fruits
EndProcedure

Procedure Basket()
  Shared With Bag() Fruits
  Fruits = 5  ; This is s_Bag.v_Fruits
EndProcedure

Procedure Bag()
  Static Fruits
  Fruits = 5  ; This is s_Bag.v_Fruits
EndProcedure

Code: Select all

; "Auto-with" in ForEach loops
ForEach StructuredList()
  \Member = 0
Next

Posted: Wed Oct 11, 2006 2:19 pm
by Trond
And #PB_Compiler_ExeFormat.

Posted: Wed Oct 11, 2006 3:15 pm
by thamarok
Agreed. I think these improvements will make it easier to deal with LinkedLists.

About #PB_Compiler_ExeFormat, I am not so sure about it, as you can select EXE in the Compiler Options. :?

Posted: Wed Oct 11, 2006 3:25 pm
by Trond

Code: Select all

CompilerIf #PB_Compiler_ExeFormat = #PB_ExeFormat_Console
  PrintN(Blah)
CompilerElse
  MessageRequester("", Blah)
CompilerEndif

Posted: Wed Oct 11, 2006 3:33 pm
by thamarok
Trond wrote:

Code: Select all

CompilerIf #PB_Compiler_ExeFormat = #PB_ExeFormat_Console
  PrintN(Blah)
CompilerElse
  MessageRequester("", Blah)
CompilerEndif
Now this explains everything.
If this would be added, I could do one version which is DLL, Console and EXE and the user would only have to choose what he wants in the Compiler Options. THis would be good and I wouldn't need to distribute each version itself.

Trond, you really have good ideas :idea: