-1

The PRACH data is saved into a tab and then moved into another tab file "ToUpdate"

Select * from PRACH_data where Obj into ToUpdate

Fetch First From ToUpdate
Do While Not EOT(ToUpdate)
circ = CreateCircle(Longitude, Latitude, r)
Fetch Next From ToUpdate
Loop

Fetch First From ToUpdate
Do While Not EOT(ToUpdate)
azimuth = ToUpdate.Azimuth
BW = ToUpdate.HBW
s = azimuth -(BW/2)
e = azimuth + (BW/2)
Create Arc into Variable pie (ObjectGeography(circ, 1), ObjectGeography(circ, 2)) (ObjectGeography(circ, 3), ObjectGeography(circ, 4)) s e
pie=converttopline(pie) 
Fetch Next From ToUpdate
Loop

Fetch First From ToUpdate
Do While Not EOT(ToUpdate)
alter Object pie Node Add (Longitude, Latitude)
pie=converttoregion(pie)
Insert into WindowInfo(FrontWindow(),10) (obj) Values (pie)
Fetch Next From ToUpdate
Loop

Commit Table ToUpdate Interactive

The thing is, the program isn't going to the NEXT row/cell in the excel file and creating a new pie at that sector... I am getting 5000 pies (same shape, same Lat, same Lot, same Beamwidth, same azimuth) but not on different points like I want..

It can be viewed in the following pic. enter image description here

Can someone help please?

  • 1
    Rather than post this as a new question, please edit your original question to include what you have done. – Fezter Feb 25 '15 at 1:45
  • I can understand the sentiment of the above comment by @Fezter. For this question not to be made a duplicate of the earlier one it may be worth using the edit button beneath each to tease the content of the two questions apart so that each becomes/stays answerable in its own right. It is often hard to draw the line between one question and the next (which may follow on from it) but is nevertheless a valuable problem-solving skill to have. – PolyGeo Feb 25 '15 at 3:26
1

The problem is that you have three loops but you don't store the individual results from the first two loops and so the third loop will only work on the last result.

Try to modify your program to only have one loop like this:

Fetch First From ToUpdate
Do While Not EOT(ToUpdate)
   circ = CreateCircle(Longitude, Latitude, r)

   azimuth = ToUpdate.Azimuth
   BW = ToUpdate.HBW
   s = azimuth -(BW/2)
   e = azimuth + (BW/2)
   Create Arc into Variable pie 
      (ObjectGeography(circ, 1), ObjectGeography(circ, 2)) 
      (ObjectGeography(circ, 3), ObjectGeography(circ, 4)) 
      s e
   pie=converttopline(pie) 

   alter Object pie Node Add (Longitude, Latitude)
   pie=converttoregion(pie)

   Insert into WindowInfo(FrontWindow(),10) (obj) Values (pie)

   Fetch Next From ToUpdate
Loop

And if you are reading your longitude, latitude and radius values from the table you need to change the statement to reflect that:

   circ = CreateCircle(ToUpdate.Longitude, ToUpdate.Latitude, ToUpdate.r)
  • Peter that worked in one loop and updating the long, lat with the new table as well. – Karl Feb 25 '15 at 18:05
  • @Karl Please take the Tour to learn about the Accept button. – PolyGeo Feb 25 '15 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.