Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

StructureType


Dams Dec 3, 2022 05:58 PM

Hi,

It's possible to use structureType as result of a user function or user subroutine ? I don't a have clues to do this ( by pointer?)


Dams Dec 7, 2022 07:07 AM

I Try this code but each time i have a crash from CR1000XComp.exe

 

StructureType device
  id As Long
  Result As Double
EndStructureType

Function f1( a As Long, r As Double) As device
  f1.id=a
  f1.Resul=r

EndFunction

Sub f2(ptr_device As device!,a As Long, r As Double)
  Dim test As device
  test.id=a
  test.Result=r
  !ptr_device=test
  'or ptr_device=@test
EndSub

Public d1 As device
Public ptr_d1 As device!
Public var_id As Long = 2
Public var_result As Double = 2543.324
BeginProg
  Scan(1,sec,0,0)

   ' d1=f1(ptr_d1,var_id,var_result)
   ' Call f2(ptr_d1,var_id,var_result)
  NextScan
EndProg

 


Legolas Mar 4, 2023 07:08 AM

This post is under review.

Log in or register to post/reply in the forum.