Solved

Migration Problem

Posted on 2004-04-06
10
786 Views
Last Modified: 2013-12-26
Hi,
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.
0
Comment
Question by:Meena_kumari
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 10772456
hi,
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.
regards,
sandeep
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 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)

-sandeep
0
 

Author Comment

by:Meena_kumari
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.
0
 
LVL 14

Expert Comment

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

although can u post entire script here?
0
 

Author Comment

by:Meena_kumari
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)
      EXECUTE UPDT_PRD_VARIANT;
      
NEXT
return 1
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 14

Expert Comment

by:sandeep_patel
ID: 10773269
hummmmm,
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 ?
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
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..

Regards,
Vikas

0
 
LVL 8

Expert Comment

by:Vikas_Dixit
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)

0
 
LVL 2

Expert Comment

by:mdhampton
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.
0
 

Author Comment

by:Meena_kumari
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.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now