Issue with single string character


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: Issue with single string character

    looks like I got hold of the wrong end of the stick again


    tried this

    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 29/11/2014                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    #CONFIG
    cfg1 = _FOSC_INTOSC
    cfg1&= _WDTE_ON
    cfg1&= _PWRTE_OFF
    cfg1&= _MCLRE_ON
    cfg1&= _CP_OFF
    cfg1&= _CPD_OFF
    cfg1&= _BOREN_ON
    cfg1&= _CLKOUTEN_OFF
    cfg1&= _IESO_ON
    cfg1&= _FCMEN_ON
      __CONFIG _CONFIG1, cfg1
    cfg2 = _WRT_OFF
    cfg2&= _PLLEN_OFF
    cfg2&= _STVREN_ON
    cfg2&= _BORV_19
    cfg2&= _LVP_OFF
      __CONFIG _CONFIG2, cfg2
    #ENDCONFIG
    
     DATA @ 100, "J", "A", "N", "F", "E", "B", "M", "A", "R", "A", "P", "R", "M", "A", "Y", "J", "U", "N", "J", "L", "Y", "A", "U", "G", "S", "E", "P", "O", "C", "T", "N", "O", "V", "D", "E", "C"
     ;DATA @ 137, "S", "U", "M", "O", "T", "U", "W", "E", "T", "H", "F", "R", "S", "A", "S", "U"
     CA_MONTH var byte[3 ]
     reg_val  var byte
       osccon=$6a    '4 mhz
       anselA=0  
     
     
     main:
      for   reg_val =1 to 12
      gosub expand_date
      Serout2 PORTA.0,84,["m",#reg_val ," ",str ca_month \3 ,13,10]
      next
      goto main
    EXPAND_DATE:
     READ 097 + (reg_val * 3) + 0, CA_MONTH[0]
     READ 097 + (reg_val * 3) + 1, CA_MONTH[1]
     READ 097 + (reg_val * 3) + 2, CA_MONTH[2]
     RETURN
    result



    Code:
    m1 JAN
    m2 FEB
    m3 MAR
    m4 APR
    m5 MAY
    m6 JUN
    m7 JLY
    m8 AUG
    m9 SEP
    m10 OCT
    m11 NOV
    m12 DEC

    so the method is sound . reg_val[5] is binary not BCD right ?
    otherwise post entire code , I suspect an array overrun is most likely problem


    ps another method using flash mem not eprom :- for more ideas
    lookup pkt[3],["xmtwtfss"], day[0]
    lookup pkt[3],["xouehrau"], day[1]
    lookup pkt[3],["xnenuitn"], day[2]
    Last edited by richard; - 28th November 2014 at 22:10.

Similar Threads

  1. Replies: 3
    Last Post: - 3rd December 2011, 22:48
  2. How to send a string with another string inside it?
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2011, 17:11
  3. SEROUT command (single byte value not string)
    By MrRoboto in forum mel PIC BASIC
    Replies: 15
    Last Post: - 12th June 2010, 03:34
  4. sending string to module GSM with character ""
    By volcane in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd May 2010, 02:26
  5. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts