View previous topic :: View next topic |
Author |
Message |
Duesentrieb72
Joined: 17 Feb 2006 Posts: 44
|
Posted: Thu Jul 06, 2017 1:35 pm Post subject: Filedatetime to Array |
|
|
Hello,
in Bascom AVR version 2.0.7.8 this works proper:
Code: |
Dim Sd_textfile_timedate(6) As Byte
Sd_textfile_timedate = Filedatetime(sd_file_name)
|
According to Help:
Syntax
Var = FILEDATETIME (file)
Var=A string variable or byte array that is assigned with the file date and time of the specified file
"When the target variable is a byte array, the array size must be at least 6 bytes."
"When you use a numeric variable, the internal file date and time format will be used"
I changed to 2.0.8.0 and get error:
Error : 261 Line : 1232 Array expected [SD_TEXTFILE_TIMEDATE] , in File :
Does anyone know the reason?
Thanks a lot,
Duesentrieb72
(BASCOM-AVR version : 2.0.8.0 , Latest : 2.0.7.8 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jul 06, 2017 1:44 pm Post subject: |
|
|
because a check was added you get this error.
you should code iit like : sd_textfile_timedate(1)= filedatetime(somefillename)
Notice the array element (1) which could also be (0) when you use base 0. _________________ Mark |
|
Back to top |
|
|
Duesentrieb72
Joined: 17 Feb 2006 Posts: 44
|
Posted: Thu Jul 06, 2017 2:25 pm Post subject: |
|
|
Hi Mark,
thanks a lot for you fast reply.
Works fine.
By the way, why
to reset watchdog is eliminated in 2.0.8.0?
Thanks,
Duesentrieb72 |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jul 06, 2017 2:33 pm Post subject: |
|
|
because wdr is an asm instruction.
you need to use ! wdr
or : reset watchdog which is the preferred way _________________ Mark |
|
Back to top |
|
|
Duesentrieb72
Joined: 17 Feb 2006 Posts: 44
|
Posted: Thu Jul 06, 2017 2:39 pm Post subject: |
|
|
Hi Mark,
I forgot that, "wdr" is assembler
"wdr" was faster than "Reset Watchdog"...
Thanks a lot.
Best regards,
Duesentrieb72 |
|
Back to top |
|
|
|