Unknown statement error in procedure from Pan 6 - arraylinebuild

I’m getting an unknown statement error for “arraylinebuild” in a procedure I’m trying to convert to X from a Pan 6 DB.

Assuming it’s the case that not everything got carried over. I wrote all the procedures in this application 18 years ago, so I have to admit that I’m not really sure what this is doing. Probable that there was a better way to do this that I couldn’t figure out at the time.

Is it the case that arraylinebuild does not exist in X? Any obvious workaround? Thanks for any help.

local total,rcount,speedpartotal
fileglobal oarray,ototal

FirstRecord

Loop

arraylinebuild oarray,";","",

?(SpeedNumber1>0,str(SpeedNumber1)+"+","")+

?(SpeedNumber2>0,str(SpeedNumber2)+"+","")+

?(SpeedNumber3>0,str(SpeedNumber3)+"+","")+

?(SpeedNumber4>0,str(SpeedNumber4)+"+","")+

?(SpeedNumber5>0,str(SpeedNumber5)+"+","")+

?(SpeedNumber6>0,str(SpeedNumber6)+"+","")+

?(SpeedNumber7>0,str(SpeedNumber7)+"+","")+

?(SpeedNumber8>0,str(SpeedNumber8)+"+","")+

?(SpeedNumber9>0,str(SpeedNumber9)+"+","")+

?(SpeedNumber10>0,str(SpeedNumber10),"")

oarray=arraystrip(oarray,"+")

oarray=oarray[1,"-0-9"]

if oarray=""

OPercent=0

else

execute “ototal=”+(oarray)

rcount=arraysize(oarray,"+")

speedpartotal=100*rcount

ototal=round((float(val(ototal))/float(val(speedpartotal)))*float(100),1)

OPercent=ototal

endif

downrecord

until info(“stopped”)

The problem is the arraylinebuild statement which no longer exists in Panorama X. Actually you did not use it correctly in Panorama 6 either since it should be used with an arrayscan( function (also not available in Panorama X). I would try rewriting the procedure this way:

local total,rcount,speedpartotal
fileglobal oarray,ototal

FirstRecord

Loop
    oarray=lineitemarray("SpeedNumber", "+")
    arrayfilter oarray, oarray,"+",?(import()="0","",import())
    arraystrip oarray,"+"
    if oarray=""
        OPercent=0
    else
        execute “ototal=”+(oarray)
        rcount=arraysize(oarray,"+")
        speedpartotal=100*rcount
        ototal=round((float(val(ototal))/float(val(speedpartotal)))*float(100),1)
        OPercent=ototal
    endif
    downrecord
until info(“stopped”)

I haven’t actually tested this myself but I think it should replicate what you originally had in Panorama 6.

1 Like

An important reference for those beginning to convert from Pan6 to PanX is this within Help:

Unimplemented Statements and Functions

I trust the list will be updated as new versions and further functionality become available.

Thanks, Gary! Will give this a try.

Thanks for the link to this list, John. Super helpful Disappointed to see that curl is not supported in X. I use that all the time, which means I will have to keep 6 around no matter what. Had hoped to make a clean break now that I’m finally engaged with X.

I now see this info about curl. Is Curl in PanX?. So that seems like a solution for me.

This page is built automatically from a database that is derived from the same database used to generate the documentation, so yes, it is updated when there is a major release.

Yes, the new Panorama X functions for url access will be better/easier than using curl in 99.999% of applications. And for the other 0.0001%, you can use curl thru a shell script (which is how it worked in Panorama 6 anyway).