Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Migration Problem

Posted on 2004-04-06
Medium Priority
Last Modified: 2013-12-26
Earlier I asked a question here for migration. Thanks for all those answers.

Now I am fixing the migration issues. The approach I followed is, copied PB9 PFC pbls into my application overrding the PB6.5 PFC's. Then migrated. Faced a very few problems on obsolete funcs. Fixed all of them but one problem I am not able to understand. In one of the application pbl's it is calling n_cst_string.of_parsetoarray() function. Migration gave "Misused Type : n_cst_string" on this line.

I checked up the n_cst_string object in both versions. There are no differences. The argument types are also same in both versions. The last one being a reference variable.

The syntax present in my object is n_cst_string.of_parsetoarray(ls_upcstring, ",", ls_upc_array[]). I do not understand in what way to fix it.

Can anyone please help. Very urgent as I have to send a migrate report today.
Question by:Meena_kumari
  • 4
  • 3
  • 2
  • +1
LVL 14

Expert Comment

ID: 10772456
1) just replace your code with declaring a variable and check

n_cst_string    inv_string
inv_string.of_parsetoarray(ls_upcstring, ",", ls_upc_array[])

variable declaration will be private or instance or globle according to your requirement.

2) also confirm that nowhere else (in other pbls of the library list), the same object (n_cst_string) is there and having different defination. but i think this will not be the case.

check with first solution.
LVL 14

Accepted Solution

sandeep_patel earned 1500 total points
ID: 10772544
oh no,
i think following is the problem

in your function calling replace ls_upc_array[] by ls_upc_array

so it will be

n_cst_string.of_parsetoarray(ls_upcstring, ",", ls_upc_array)


Author Comment

ID: 10772761
Hi Sandeep,
Thanks for the answers. I tried both options earlier itself.
The first option we cannot do because it is an autoinstantiate class, and doesn't require a variable declaration of its type. The second option, The original code was having no brackets after ls_upc_array. I tested it with brackets. Both din't work.

Now I am planning to temporarily comment the code, migrate, and uncomment in PB9, see what happens. Let me try this out.

Meanwhile if you can think of any other solutions please post them. Thanks alot.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 14

Expert Comment

ID: 10773010
ya, commenting the code will definately work.

although can u post entire script here?

Author Comment

ID: 10773098
Sandeep, please find the script here.

// Script for n_cst_proc_fndg_b120.of_updateprdvariant event.
// Arguments:
//            None
// Return: (integer)
//            1      -      Cancel/Error
//            0      -      Continue
// Description:
//            Loads the product variant table.

long ll_maxrows, ll_row, ll_upper, ll_cnt, ll_vnpk_qty
string ls_upc, ls_cb_ent_id, ls_cb_role_id, ls_upc_array[], ls_upc_null[]
string ls_itemnumber, ls_new_upc
boolean lb_upc_fnd

//default vnpk_qty
ll_vnpk_qty = 1
DECLARE UPDT_PRD_VARIANT PROCEDURE FOR FNDG_UPDT_PRD_VAR(:ls_cb_ent_id, :ls_cb_role_id, :ls_itemnumber, :ls_new_upc, :ll_vnpk_qty);

ll_maxrows = ids_variant.RowCount()
FOR ll_row = 1 to ll_maxrows
      ls_upc = ids_variant.Object.upc[ll_row]
      ls_cb_ent_id = ids_variant.Object.cb_ent_id[ll_row]
      ls_cb_role_id = ids_variant.Object.cb_role_id[ll_row]
      ls_itemnumber = ids_variant.Object.variant_nbr[ll_row]
      ls_upc_array = ls_upc_null
      n_cst_string.of_ParseToArray(ls_upc, ',', ls_upc_array)
      ls_new_upc = this.of_getupc(ls_upc_array)
return 1
LVL 14

Expert Comment

ID: 10773269
your script is ok...no problem... I copied it to my application with commenting procedure and the line

ls_new_upc = this.of_getupc(ls_upc_array)

it's compiled OK...have u checked with comment ? Are u sure that n_cst_string.of_parsetoarray(ls_upc,',',ls_upc_array) is the only line that causing the problem ?

Expert Comment

ID: 10773506
Well to me, This kind of code gives me warning : Undefined Variable :n_cst_string
I am surprized it's working for you.... Check you don't have variabled declared as :

n_cst_string n_cst_string

( if not, you can try decaring, may work but it's not the proper way..)

This is not the correct way to call function.. Even if n_cst_string is autoinstantiate, you need to declare a variable of that type and call metods on that variables. These methods are not Static mathods ( so that you can refer them by the Class..)
Auto Instantiate means you need not call create and destroy, and some difference in memory allocation..



Expert Comment

ID: 10773518
Normally in a PFC app, String service will be delared as an instance variable of the app mager, and you will call functions as :

gnv_app.inv_string.of_ParseToArray(ls_upc, ',', ls_upc_array)


Expert Comment

ID: 10773631
Well, lots of information above, but here is the gist of the problem: Trying to use a "class" function. Class functions are not supported in PowerBuilder, but most versions let you call them anyway, and sometimes they even work. Most of the time though, they cause the application to die. Like the first person said, changing the call to this will solve the problem:

n_cst_string lnv_string
string ls_upcString, ls_upc_array[]

lnv_string.of_parseToArray (ls_upcString, ",", ls_upc_array)

Note two important changes: Removal of the [] in the function call, and replacing n_cst_string with a local variable of type n_cst_string.

Author Comment

ID: 10773763
Hi, Thanks to all.

As I said, I migrated with commenting that piece of code, opened that object in PB9, declared local variable of type n_cst_string and called the function with that variable.
This got compiled without problems.

Thanks for all, I agree with all of your options.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question