Creating new global variable in Smalltalk pool dictionary

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Creating new global variable in Smalltalk pool dictionary

Postby mmahesh_k » Sun Mar 02, 2008 5:25 pm

Hi,

I am trying to set a value to the new global variable at the time of packaging the runtime image but it is not getting set in Smalltalk pool dictionary.

I have tried this by initiating the global variable in the method packagingRulesFor: which is a class method of the application where the global variable is used.

packagingRulesFor: aPackagedImage

Smalltalk at: #MyGlobalVariable put: #value.

The above approach doesn't work for me. If someone have already done this could you please help me.

Thanks,
MK
mmahesh_k
 
Posts: 9
Joined: Wed Nov 14, 2007 10:11 am

Re: Creating new global variable in Smalltalk pool dictionary

Postby daswartz » Sun Mar 02, 2008 5:50 pm

mmahesh_k wrote:I am trying to set a value to the new global variable at the time of packaging the runtime image but it is not getting set in Smalltalk pool dictionary.

I have tried this by initiating the global variable in the method packagingRulesFor: which is a class method of the application where the global variable is used.packagingRulesFor: aPackagedImage Smalltalk at: #MyGlobalVariable put: #value.

The above approach doesn't work for me.


The approach you're using definitely won't work if you are using the XD packager. It's been too many years since I used the packager in a non-XD image for me to say.

While I have never used it, you can try using:

Code: Select all
packagingRulesFor: aPackagedImage
aPackagedImage
   initializeGlobalVariable: #MyGlobalVariable
   to: #value


Another option is to define a class variable to hold the object you want in the packaged image. If you do that, then you can use

Code: Select all
aPackagedImage
initializeClassVariable: 'MyGlobalVariable'
   to: #value
   inClassNamed: #MyGlobalHolderClass.



Doug Swartz
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA

Re: Creating new global variable in Smalltalk pool dictionary

Postby mmahesh_k » Tue Mar 04, 2008 8:27 am

Hi Doug,
Thanks for the information. The solution you have suggested works well for the object that are derived from Object.
The caching of deployed wsdl object (SstWSService) at the packaging time is throwing an error. It seems SstWSService object cannot be cached at packaging time, this is bcz SstWSService is derived from SstObject, the method SstObject >> instVarAt:. doesn't allow to complete the packaged image with the deployed service objects. This method is called when dumping the service objects and it dispatches a service request that throws error.

Did someone tried to package the runtime image with deployed wsdl objects (SstWSService)?

Thanks,
Mahesh
mmahesh_k
 
Posts: 9
Joined: Wed Nov 14, 2007 10:11 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest