Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

VBS Dynamic Arrays ???


Recommended Posts

Why can't I use a dynamic array in VBS? Do I need to test how many elements there will be, then redim the array with the proper size?

This fails, subscript out of range..

code:

Dim a()

Dim b

b = 0

For b = 0 To 3

a(
B)
= b

ShowString a(
B)

Next

This works...

code:

Dim a(3)

Dim b

b = 0

For b = 0 To 3

a(
B)
= b

ShowString a(
B)

Next

'Rekd teh banghead.gif

Link to comment
Share on other sites

Ahh, lernt a new option, Preserve... TY.

 

One more thing, O/T from this, but related in my own little world... Is there a way, outside VBS, to temporarilly over-ride the NCI destination?.

 

I have a file with 6 Groups, totalling 53 Ops. Each group has a different NCI destination. I want to be able to post them all to a single NCI, but not lose the original destinations. Possible? Or will I be writing a script for that?? wink.gif

 

'Rekd

Link to comment
Share on other sites

quote:

I want to be able to post them all to a single NCI, but not lose the original destinations. Possible? Or will I be writing a script for that?


What a coinkydink wink.gif I'm working on a C-Hook to do the exact same thing. I'd like to add to your question, Rekd, if you don't mind. Anyone know how to suppress the NC and NCI file location/overwrite prompts when posting using nci_manager() with the NCIMGR_POST_ONE flag?

Link to comment
Share on other sites

Bullines,

 

Look at postOps() in m_nc.h and post_dlg_settings in m_ncvars.h. It should do some of what you want. I for banghead.gif for the life of me can't banghead.gif get them to work right. Things like the nc extension overide variable in the post don't set right plus some other stuff I can't remember off the top of my head right now. I eventually gave up trying to get it to work and turned my attentions to more productive projects. Maybe you can have better luck.

 

Bryan smile.gif

Link to comment
Share on other sites

Thanks for the tip Bryan cheers.gif Unfortunately, it still prompts for NC/NCI file locations and overwriting mad.gif Hmmmm confused.gif

 

code:

// my settings

post_dlg_settings my_settings;

 

// init the members of the post_dlg_settings structure

my_settings.save_nci_file = TRUE;

my_settings.overwrite_nci = TRUE;

my_settings.save_nc_file = TRUE;

my_settings.overwrite_nc = TRUE;

my_settings.send_to_machine = FALSE;

my_settings.editNCI = FALSE;

my_settings.editNC = FALSE;

my_settings.export_oplist = TRUE;

my_settings.export_prm = TRUE;

my_settings.wcs_1014 = FALSE;

my_settings.descriptor = TRUE;

 

// post it up

postOps(&my_settings, "mpmaster.pst", nc_prefix, FALSE, FALSE);

Link to comment
Share on other sites

I spoke a little too soon. It seems that postOps posts all operations.

 

code:

// get the head of the operations linked list

list_manager(OP_ID, "", LSTMGR_GET, &op_ptr);

 

while(op_ptr)

{

// get the operation

operation_manager(&(op_ptr->op), OPMGR_GET, &ent_ptr, &bSuccf);

.

.

.

// next operation

op_ptr = op_ptr->next_ptr;

}

In the while loop, I call postOps and I plan to grab the NCI filename of each operation during each iteration of the while loop from the nci_filename variable. This works if you use NCIMGR_POST_ONE with nci_manager() but not now, since nci_filename is still holding the filename of the first operation frown.gif

Link to comment
Share on other sites

quote:

I am whining here

NO

 

quote:

But I do like to see CNC Software release a new documentation of the chook library. It really needs an update!

+1000000000

 

With some real world examples. Add points to drill, add chain to contour, create surfs, import ops, import tools, create tools, POST, yada yada yada. Everything you'd probably do on a day to day basis but with a chook. That way it could be done better with a chook or at least automate the steps to make it faster.

 

Bryan smile.gif teh fustrated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...