You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Micha

Beginner

  • "Micha" started this thread

Posts: 3

Date of registration: Dec 22nd 2009

  • Send private message

1

Tuesday, December 22nd 2009, 3:03am

32Bit floating Point Calculator Problem

Hi, i have a Problem with my Sourcecode.
The Code calculate Decimal to floating Hex Value.

Jabaco say when i run the Application;
Compile Error. Class 'Applet1' line: 23
Expected: End Statement


Here my Source:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Private Type UDT1
  Z1 As Single
End Type
 
Private Type UDT2
  Z1 As Long
End Type



Public Sub Command1_Click()

Dim Value1 As UDT1, Value2 As UDT2
  
  Wert1.Z1 = Text1.Text
  Lset Value2 = Value1  <--- This line make a problem ;( 

  Text2.Text = Hex$(Value2.Z1)
  Label2.Caption = Value1.Z1 + Value2.Z1
End Sub


Can you help me please? ;(

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Tuesday, December 22nd 2009, 10:48am

Hi,
Jabaco has no built-in LSET command to byte-copy one UDT into another UDT.
Jabaco usually copies variables just by assigning them (without SET).
There is a Cast() function to map otherwise incompatible types, but this does not work for your example as Java simply refuses to do what you want.

You might go on and dig this forum. Stefan Schnell invented a VarPtr library to do all sorts of fancy things with addresses of variables.
Use "Option Explicit" as first line of your code to uncover unresolved references.

Copying UDTs byte by byte is rather implementation dependent. You have to know exactly how the UDT variables are represented in memory.
This is quite against the philosophy of Java were all variables and objects are "somewhere" in memory without known size and without known location.

Success!

A1880

Rate this thread
WoltLab Burning Board