Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Search found 308 matches
www.mcselec.com Forum Index
Author Message
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Fri Feb 05, 2021 9:27 am   Subject: Is there a way to know which type is a variable?
OK
It does not return the full space ocuppied by a string in SRAM, ... string*10 retunrs 10, not 11.
Also, it does not work with arrays larger than 255 elements.
But for my purpose (to identify by ...
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 11:52 pm   Subject: Is there a way to know which type is a variable?
Hello MKS
First of all I truly appreciate you sharing your experiencie.
Second, and this is for anyone reading this thread, I'm writing the code almost real time, it sure is useful to get ideas, but ...
  Topic: How to convert several variables into an array of bytes?
hzz

Replies: 11
Views: 422

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 7:29 pm   Subject: Working code
Please see a better solution at:
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=80030#80030
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 7:28 pm   Subject: Is there a way to know which type is a variable?
Here is the working code of what I pretended to do
Thanks all!
'____________________________________________________________________________________
' Given any sequence of variables of type Byte, ...
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 4:02 pm   Subject: Is there a way to know which type is a variable?
I do read the threads and appreciate very much the time you take to answer.

I read your post and tested Varptr("var") but it didn't work so I thought it was just for EEPROM variables; maybe I rea ...
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 12:25 pm   Subject: Is there a function to know the address where the SRAM varia
Is there a function to know the address where an SRAM variable is stored?

Knowing this address and the size of the variable it will be possible read the bytes that the variable is made of
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 12:06 pm   Subject: Is there a way to know which type is a variable?
Thanks Mark!
Sizeof is just what I was looking for. (It is not in BASCOM help)
  Topic: Is there a way to know which type is a variable?
hzz

Replies: 16
Views: 628

PostForum: BASCOM-AVR   Posted: Wed Jan 27, 2021 8:42 am   Subject: Is there a way to know which type is a variable?
Is there a way to know which type is a variable? or at least the number of bytes of a variable for instance a function that returns 4 for a Long, 2 for a Word, etc.

(BASCOM-AVR version : 2.0.8.3 )
  Topic: How to convert several variables into an array of bytes?
hzz

Replies: 11
Views: 422

PostForum: BASCOM-AVR   Posted: Tue Jan 26, 2021 2:14 pm   Subject: How to convert several variables into an array of bytes?
The original code is in several files and with comments in Spanish so I edited some partes in the Forum, with mistakes as I see. The following is copied form the original working OK

I'm using it to ...
  Topic: How to convert several variables into an array of bytes?
hzz

Replies: 11
Views: 422

PostForum: BASCOM-AVR   Posted: Tue Jan 26, 2021 12:31 pm   Subject: How to convert several variables into an array of bytes?
This is the solution I have implemented (I have tested and is OK but the following is extracted from a longer code so not all variables are declared)
' Binary Registers have the following format& ...
  Topic: How to convert several variables into an array of bytes?
hzz

Replies: 11
Views: 422

PostForum: BASCOM-AVR   Posted: Mon Jan 25, 2021 10:51 pm   Subject: How to convert several variables into an array of bytes?
Thanks Evert!
What you propose will solve my example but I cannot use a fixed array as the variables are not always the same. The problem is the following:

Given any sequence of variables of type ...
  Topic: How to convert several variables into an array of bytes?
hzz

Replies: 11
Views: 422

PostForum: BASCOM-AVR   Posted: Mon Jan 25, 2021 9:05 pm   Subject: How to convert several variables into an array of bytes?
Dim Btemp as Byte : Btemp=33
Dim Wtemp as Word : Wtemp=222
Dim Ltemp as Long : Ltemp = 111
Dim Data_str as string * 200
Dim Data_arr(201) As Byte At Data_str Overlay

I would ...
  Topic: Error compiling PUT and GET using HW SPID Solved) - Problem
hzz

Replies: 24
Views: 1257

PostForum: BASCOM-AVR   Posted: Mon Jan 25, 2021 3:44 pm   Subject: Error compiling PUT and GET using HW SPID Solved) - Problem
Please notice that GET does not work either. In some cases the bytes read form a file are wrong. You need to close the file and open it again before reading.

This code
For Ltemp = Reg_in ...
  Topic: Error compiling PUT and GET using HW SPID Solved) - Problem
hzz

Replies: 24
Views: 1257

PostForum: BASCOM-AVR   Posted: Wed Nov 25, 2020 4:51 pm   Subject: Error compiling PUT and GET using HW SPID Solved) - Problem
Thanks Mark
- you should watch the GBDOSERROR variable.
OK, I have printed it and is always 0, even when Seek doesn`t work well
- using get/put will change the location so you get a difference
But ...
  Topic: Error compiling PUT and GET using HW SPID Solved) - Problem
hzz

Replies: 24
Views: 1257

PostForum: BASCOM-AVR   Posted: Tue Nov 24, 2020 11:00 pm   Subject: Error compiling PUT and GET using HW SPID Solved) - Problem
The behavior can be different with different files even when all files are created with the same code (at least the first part when the file is open is always exactly the sale)

The following behavi ...
 
Page 1 of 21 Goto page 1, 2, 3 ... 19, 20, 21  Next
All times are GMT + 1 Hour
Jump to: