Solved

Migration Problem

Posted on 2004-04-06
10
802 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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.

 
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
 
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

623 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