Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Refresch appropriate Data from ascii  to a Form (Read 4509 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #15 - Jul 13th, 2005 at 8:52pm
Print Post Print Post  
Hello Dr. Belhareth,

In global code of the mass update add the following line on line 4.

Code
Select All
writeln(gsFile) 



So the entire global code section would look like this.
Code
Select All
Stat gsFile as String

gsFile = @Insert("ToImport.txt")
writeln(gsFile) 



Does anything appear in the window that pops up?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #16 - Jul 14th, 2005 at 4:50pm
Print Post Print Post  
Hello Ray,

with the Import file  without path  It still not working and does anything appear in the window that pops up !

With the path " C:\sesame\ToImport.TxT"  a get the file in the editor bat the import does not happen!

Thank you for taking the time to make such a nice post! 

Dr. Belhareth
« Last Edit: Jul 15th, 2005 at 10:55am by Amor »  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #17 - Jul 20th, 2005 at 8:44pm
Print Post Print Post  
Hello Ray,

with the Import file  without path  It still not working and does anything appear in the window that pops up !

With the path " C:\sesame\ToImport.TxT"  a get the file in the editor bat the import does not happen!

Thank you for taking the time to make such a nice post! 

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #18 - Jul 20th, 2005 at 9:18pm
Print Post Print Post  
Hello Dr. Belhareth,

Leave the path in Global Code as "C:\sesame\ToImport.txt" for the following tests.

Replace the code in the CustNum Mass Update event with the following code

Code
Select All
 Var vData as String
Var vRecData as String
Var vItem as String
Var vCnt as Int
Var vLoop as Int
Var vRecCnt as Int
Var vRecLoop as Int
Var vQuit as Int
Var vResult as Double

writeln("gsfile contains [" + gsfile + "] #1")

SetStringArraySeparator(@Newline())
//Get all Data in the File for this Customer
vData = @SearchStringArray(gsFile, @Str(CustNum) + "..")

writeln("vData contains [" + vData + "]")

//Remove the data for this customer from the file as it is no longer needed.
gsFile = @DifferenceStringArray(gsFile, vData)

writeln("gsfile contains [" + gsfile + "] #2")

vCnt = @CountStringArray(vData)
writeln("Number of recs " + @str(vCnt))
vLoop = 1
vRecCnt= @FormResultSetTotal("NewForm0")
writeln(@str(vRecCnt) + " Records in the subform")
vRecLoop = 1
vQuit = 0

//Loop through the data from the text file
While vLoop <= vCnt
{
 vRecData = @AccessStringArray(vData, vLoop)
writeln("RecData is [" + vRecData + "]")
 RestoreStringArraySeparator()
 //Parse apart
 vItem = @AccessStringArray(vRecData, 2)
 vResult = @AccessStringArray(vRecData, 3)

 //Loop through the subform looking for the record that matches
 While ((vRecLoop <= vRecCnt) And (vQuit = 0))
 {
  If @FormFieldValue("NewForm0", "Metal Type", vRecLoop) = vItem Then
  {
writeln("Found a match")
   //Record found. Lets put the result in the subform.
   FormFieldValue("NewForm0", "Result", vRecLoop, vResult)
writeln("Value set to " + @FormFieldValue("NewForm0", "Result", vRecLoop))
   If @ToMoney(@FormFieldValue("NewForm0", "Result", vRecLoop)) <> vResult Then
   {
    Writeln("Failed to set the result Element on record " + vRecLoop)
   }
   vQuit = 1
  }
  vRecLoop = vRecLoop + 1
 }
 vRecLoop = 1
 vQuit = 0
 SetStringArraySeparator(@Newline())
 vLoop = vLoop + 1
} 



Run the mass update.
Copy every thing that shows up in the WriteLn window. Ctrl C will copy from that window.
Paste it here so I can see what is happening.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #19 - Jul 23rd, 2005 at 9:38pm
Print Post Print Post  
Hello Ray,
after running the massupdate i get:

3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 0
10 Records in the subform

Thanks.
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #20 - Jul 25th, 2005 at 2:04pm
Print Post Print Post  
Hello Dr. Belhareth,

There is more to the debug than what you posted. What you will need to do is click at the end of the debug, hold down the shift key, and keep hitting the up arrow to select all the debug.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #21 - Aug 17th, 2005 at 11:27am
Print Post Print Post  
Hello Ray !

I am back und thank you for the support.
After running the massupdate i get this debug:

1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109

Thanks.
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #22 - Aug 17th, 2005 at 1:43pm
Print Post Print Post  
Dr. Belhareth,

The entire debug should look more like this. I believe you are still missing some of it.

gsfile contains [1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109
] #1
vData contains [1;Silver;12341;Plat;123.41;Iron;12.34]
gsfile contains [2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 3
5 Records in the subform
RecData is [1;Silver;1234]
Found a match
Value set to 1234.000000
RecData is [1;Plat;123.4]
Found a match
Value set to 123.400000
RecData is [1;Iron;12.34]
Found a match
Value set to 12.340000
gsfile contains [2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains [2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7]
gsfile contains [3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 7
7 Records in the subform
RecData is [2;Tita;1]
Found a match
Value set to 1.000000
RecData is [2;Alum;2]
Found a match
Value set to 2.000000
RecData is [2;Plat;3]
Found a match
Value set to 3.000000
RecData is [2;Silver;4]
Found a match
Value set to 4.000000
RecData is [2;Gold;5]
Found a match
Value set to 5.000000
RecData is [2;Ore;6]
Found a match
Value set to 6.000000
RecData is [2;Iron;7]
Found a match
Value set to 7.000000
gsfile contains [3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains [3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13]
gsfile contains [4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 13
13 Records in the subform
RecData is [3;Silver;1]
Found a match
Value set to 1.000000
RecData is [3;Iron;2]
Found a match
Value set to 2.000000
RecData is [3;Tungsten;3]
Found a match
Value set to 3.000000
RecData is [3;Alloy;4]
Found a match
Value set to 4.000000
RecData is [3;Aluminum;5]
Found a match
Value set to 5.000000
RecData is [3;Plat;6]
Found a match
Value set to 6.000000
RecData is [3;Gold;7]
Found a match
Value set to 7.000000
RecData is [3;Nickel;8]
Found a match
Value set to 8.000000
RecData is [3;Tita;9]
Found a match
Value set to 9.000000
RecData is [3;Steel;10]
Found a match
Value set to 10.000000
RecData is [3;Stainless;11]
Found a match
Value set to 11.000000
RecData is [3;Brass;12]
Found a match
Value set to 12.000000
RecData is [3;Copper;13]
Found a match
Value set to 13.000000
gsfile contains [4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains [4;Silver;14;Gold;24;Brass;34;Copper;4]
gsfile contains [5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 4
3 Records in the subform
RecData is [4;Silver;1]
Found a match
Value set to 1.000000
RecData is [4;Gold;2]
Found a match
Value set to 2.000000
RecData is [4;Brass;3]
Found a match
Value set to 3.000000
RecData is [4;Copper;4]
gsfile contains [5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains [5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109]
gsfile contains [] #2
Number of recs 10
10 Records in the subform
RecData is [5;Copper;100]
Found a match
Value set to 100.000000
RecData is [5;Iron;101]
Found a match
Value set to 101.000000
RecData is [5;Steel;102]
Found a match
Value set to 102.000000
RecData is [5;Nickel;103]
Found a match
Value set to 103.000000
RecData is [5;Brass;104]
Found a match
Value set to 104.000000
RecData is [5;Gold;105]
Found a match
Value set to 105.000000
RecData is [5;Silver;106]
Found a match
Value set to 106.000000
RecData is [5;Alloy;107]
Found a match
Value set to 107.000000
RecData is [5;Alum;108]
Found a match
Value set to 108.000000
RecData is [5;Tita;109]
Found a match
Value set to 109.000000


-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #23 - Aug 17th, 2005 at 5:22pm
Print Post Print Post  
Hello Ray !

I believe the Problem is in the ToImport.txt file.  Can you mail please that file again on amor5143@aol.com.

Thanks.
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #24 - Aug 17th, 2005 at 6:40pm
Print Post Print Post  
I'll be glad to send it to you again. Save it to the C:\Sesame folder and you should be good to go. It should be on it's way right now.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #25 - Aug 18th, 2005 at 11:46am
Print Post Print Post  
Hello Ray!

Hier is the debug:


1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109


gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109

] #1
vData contains []
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109
] #2
Number of recs 0
5 Records in the subform
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109
] #1
vData contains []
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 0
7 Records in the subform
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains []
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 0
13 Records in the subform
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains []
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 0
3 Records in the subform
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #1
vData contains []
gsfile contains [
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109] #2
Number of recs 0
10 Records in the subform


and Thanks again.

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #26 - Aug 18th, 2005 at 1:32pm
Print Post Print Post  
Hello Dr Belhareth.

hmm that is odd. Hopefully this is the last set of debug.  Replace the code in the CustNum Mass Update event with the following code

Code
Select All
Var vData as String
Var vRecData as String
Var vItem as String
Var vCnt as Int
Var vLoop as Int
Var vRecCnt as Int
Var vRecLoop as Int
Var vQuit as Int
Var vResult as Double


SetStringArraySeparator(@Newline())
//Get all Data in the File for this Customer
vData = @SearchStringArray(gsFile, @Str(CustNum) + "..")

writeln("Searching for a customer number of [" + @Str(CustNum) + ".." + "]")

//Remove the data for this customer from the file as it is no longer needed.
gsFile = @DifferenceStringArray(gsFile, vData)

vCnt = @CountStringArray(vData)
vLoop = 1
vRecCnt= @FormResultSetTotal("NewForm0")
vRecLoop = 1
vQuit = 0

//Loop through the data from the text file
While vLoop <= vCnt
{
 vRecData = @AccessStringArray(vData, vLoop)
 RestoreStringArraySeparator()
 //Parse apart
 vItem = @AccessStringArray(vRecData, 2)
 vResult = @AccessStringArray(vRecData, 3)

 //Loop through the subform looking for the record that matches
 While ((vRecLoop <= vRecCnt) And (vQuit = 0))
 {
  If @FormFieldValue("NewForm0", "Metal Type", vRecLoop) = vItem Then
  {
   //Record found. Lets put the result in the subform.
   FormFieldValue("NewForm0", "Result", vRecLoop, vResult)
   If @ToMoney(@FormFieldValue("NewForm0", "Result", vRecLoop)) <> vResult Then
   {
    Writeln("Failed to set the result Element on record " + vRecLoop)
   }
   vQuit = 1
  }
  vRecLoop = vRecLoop + 1
 }
 vRecLoop = 1
 vQuit = 0
 SetStringArraySeparator(@Newline())
 vLoop = vLoop + 1
} 



Run it and you should get five lines of debug. Post those lines here so I can see what is happening.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #27 - Aug 18th, 2005 at 9:11pm
Print Post Print Post  
Hello Ray,

hier is the debug:

Searching for a customer number of [1,..]
Searching for a customer number of [2,..]
Searching for a customer number of [3,..]
Searching for a customer number of [4,..]
Searching for a customer number of [5,..]


Thanks.
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #28 - Aug 19th, 2005 at 2:05pm
Print Post Print Post  
Hello Dr. Belhareth,

When you have a chance could you give the following code a run in the Mass update.

Code
Select All
Var vData as String
Var vRecData as String
Var vItem as String
Var vCnt as Int
Var vLoop as Int
Var vRecCnt as Int
Var vRecLoop as Int
Var vQuit as Int
Var vResult as Double


SetStringArraySeparator(@Newline())
//Get all Data in the File for this Customer
vData = @SearchStringArray(gsFile, @Str(@Int(CustNum)) + "..")

//You can remove these next two lines after everything is working fine
writeln("Searching for a customer number of [" + @Str(@Int(CustNum)) + ".." + "]")
writeln("Length of vData " + @Str(@Len(vData)))

//Remove the data for this customer from the file as it is no longer needed.
gsFile = @DifferenceStringArray(gsFile, vData)

vCnt = @CountStringArray(vData)
vLoop = 1
vRecCnt= @FormResultSetTotal("NewForm0")
vRecLoop = 1
vQuit = 0

//Loop through the data from the text file
While vLoop <= vCnt
{
 vRecData = @AccessStringArray(vData, vLoop)
 RestoreStringArraySeparator()
 //Parse apart
 vItem = @AccessStringArray(vRecData, 2)
 vResult = @AccessStringArray(vRecData, 3)

 //Loop through the subform looking for the record that matches
 While ((vRecLoop <= vRecCnt) And (vQuit = 0))
 {
  If @FormFieldValue("NewForm0", "Metal Type", vRecLoop) = vItem Then
  {
   //Record found. Lets put the result in the subform.
   FormFieldValue("NewForm0", "Result", vRecLoop, vResult)
   If @ToMoney(@FormFieldValue("NewForm0", "Result", vRecLoop)) <> vResult Then
   {
    Writeln("Failed to set the result Element on record " + vRecLoop)
   }
   vQuit = 1
  }
  vRecLoop = vRecLoop + 1
 }
 vRecLoop = 1
 vQuit = 0
 SetStringArraySeparator(@Newline())
 vLoop = vLoop + 1
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #29 - Aug 19th, 2005 at 4:44pm
Print Post Print Post  
Hello Ray,

I think the chance is coming, hier is the entire debug :


1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5
3;Plat;6
3;Gold;7
3;Nickel;8
3;Tita;9
3;Steel;10
3;Stainless;11
3;Brass;12
3;Copper;13
4;Silver;1
4;Gold;2
4;Brass;3
4;Copper;4
5;Copper;100
5;Iron;101
5;Steel;102
5;Nickel;103
5;Brass;104
5;Gold;105
5;Silver;106
5;Alloy;107
5;Alum;108
5;Tita;109


Searching for a customer number of [1,..]
Length of vData 0
Searching for a customer number of [2,..]
Length of vData 0
Searching for a customer number of [3,..]
Length of vData 0
Searching for a customer number of [4,..]
Length of vData 0
Searching for a customer number of [5,..]
Length of vData 0

Thanks for your  feedback!
- Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print