Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-03-2011, 01:06 PM
CREvans CREvans is online now
Registered User
 
Join Date: 03-10-2008
Location: Iowa
Posts: 28
RUNPROGRAM_PROCESSID issue

I'm trying to do some parallel tasks and am using a method similar to the example chain.bld program. This works as long as the child builds are set to not wait for completion. However, if I set them (either accidently or on purpose) to wait until completion the vbld_StepDone() fails because the RUNPROGRAM_PROCESSID macro doesn't get created. It appears as if this macro is only being created if the child is not set to wait until completion before continuing.

I know typically one wouldn't want to run things in parallel, but have one of the tasks wait until completion, but we are.

Is this a bug, or expected behavior? I can code around the issue if needed, but want to wait to make sure it's not a bug first.

Thanks!
Scott
Reply With Quote
  #2  
Old 06-03-2011, 02:05 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
It is by design that no RUNPROGRAM_PROCESSID macro is created when a step that runs a program is configured to wait for until completion.
http://www.kinook.com/VisBuildPro/Ma...gramaction.htm

There's not really a use for the ID, since the process will already be gone when the step completes...
Reply With Quote
  #3  
Old 06-03-2011, 02:14 PM
CREvans CREvans is online now
Registered User
 
Join Date: 03-10-2008
Location: Iowa
Posts: 28
I can see the point in that, but it makes dealing with different scenarios a bit more difficult, in case someone checks the "wait until completion" box, the dependency on that macro being there will fail. For anyone else who might come across this sort of error in the future and is searching the Forums for a resolution, here is what I ended up doing, to handle whether the RUNPROGRAM_PROCESSID exists or not. It is assumed that there won't be a process numbered 999999 out there, which is why I chose that number to default to.


Sub vbld_StepDone()

' store this step's process ID in another temporary macro
if vbld_AllMacros()("RUNPROGRAM_PROCESSID") is nothing then
vbld_TempMacros().Add "Child_ID", "999999"
else
vbld_TempMacros().Add "Child_ID", vbld_TempMacro("RUNPROGRAM_PROCESSID").Value
end if

End Sub
Reply With Quote
  #4  
Old 06-03-2011, 02:56 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I would recommend something more like:
Code:
If Step.Property("wait") Then
  ' if waiting, there is no process id, just store an empty string
  vbld_TempMacros().Add "Child_ID", ""
Else
  vbld_TempMacros().Add "Child_ID", vbld_TempMacro("RUNPROGRAM_PROCESSID").Value
End If
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:15 PM.


Copyright © 1999-2023 Kinook Software, Inc.