Loading ...
Sorry, an error occurred while loading the content.

Re: Resistor Color Code

Expand Messages
  • Gordon S
    Here is my attempt. Do as you wish wiith the code. Gordon S. M3YXH RESISTOR Colour Codes nomainwin : dim c$(10) WindowWidth = 500 : WindowHeight = 400 open
    Message 1 of 40 , Dec 1, 2010
    • 0 Attachment
      Here is my attempt. Do as you wish wiith the code. Gordon S. M3YXH


      ' RESISTOR Colour Codes
      nomainwin : dim c$(10)
      WindowWidth = 500 : WindowHeight = 400
      open "Colour Codes" for graphics as #r
      #r "trapclose [quit]; down; font fixedsys"
      [start]
      #r "cls; place 200 20; backcolor white; color black" : #r "\RESISTORS"
      #r "place 100 170" : #r "\RESISTOR / CAPACITOR Colour Codes"
      #r "place 150 280; color red" : #r "\Select the 3 colours"
      #r "color black"
      for d = 0 to 9
      #r "place ";d*30+106;" 190" : #r "\";d
      next d
      #r "backcolor lightgray"
      #r "place 170 30; boxfilled 320 60"
      #r "place 170 80; box 320 110"
      #r "size 3; line 100 45 170 45; line 320 45 390 45"
      #r "line 100 95 170 95; line 320 95 390 95; size 1"

      xp = 100 : restore
      for c = 1 to 10
      read d$ : c$(c) = d$
      #r "backcolor ";c$(c)
      #r "place ";xp;" 200; boxfilled ";xp+20;" 240"
      xp = xp + 30
      next c
      #r "backcolor white;when leftButtonDown [pick]" : r = 1
      xr = 190 : n = 1 : v$ = "" : wait
      [show]
      #r "backcolor ";c$(k+1)
      if n < 3 then v$ = v$ + str$(k)
      if n = 1 then #r "place 170 80; boxfilled 320 110"
      if n = 2 then #r "place 170 80; boxfilled 190 110"
      if n = 3 then #r "place 250 96; circlefilled 14"
      #r "place ";xr;" 30; boxfilled ";xr+10;" 60"
      xr = xr + 20 : n = n + 1 : if n < 4 then wait
      #r "backcolor darkgray; place 250 30; boxfilled 260 60"
      #r "place 300 80; boxfilled 320 110"
      #r "color yellow; place 60 280"
      #r "\ Tolerance: Gold 5% Silver 10% Unmarked 20% "
      #r "color darkblue; backcolor white; place 160 300"
      for z = 1 to k : v$ = v$ +"0" : next
      #r "\SELECTED VALUE = ";v$ : #r "place 100 320; color black"
      #r "\Preferred values and multiples are :-"
      #r "\ 10 12 15 18 22 27 33 39 47 56 68 82"
      #r "flush" : confirm "Another?"; q$
      if q$ = "yes" then [start]
      #r "when leftButtonDown" : wait

      [pick]
      if MouseY > 240 or MouseY < 200 then wait
      x1 = 100 : x2 = 120 : c = 99
      for t = 1 to 10
      if MouseX > x1 and MouseX < x2 then k = t-1
      x1 = x1 + 30 : x2 = x2 + 30
      next
      r = r + 1 : goto [show]

      [quit] close #r : end

      data "black","130 50 10","red","220 120 20","yellow"
      data "green","blue","150 30 200","darkgray","white"
      end
    • Gordon S
      I just woke up and found my old program for showing the colour codes Gordon S. RESISTOR Colour Codes nomainwin : dim c$(10) WindowWidth = 500 : WindowHeight
      Message 40 of 40 , Nov 2, 2011
      • 0 Attachment
        I just woke up and found my old program for showing the colour codes

        Gordon S.

        ' RESISTOR Colour Codes
        nomainwin : dim c$(10)
        WindowWidth = 500 : WindowHeight = 400
        open "Colour Codes" for graphics_nsb as #r
        #r "trapclose [quit]; down; font fixedsys"
        [start]
        #r "cls; place 200 20; backcolor white; color black" : #r "\RESISTORS"
        #r "place 100 170" : #r "\RESISTOR / CAPACITOR Colour Codes"
        #r "place 150 280; color red" : #r "\Select the 3 colours"
        #r "color black"
        for d = 0 to 9
        #r "place ";d*30+106;" 190" : #r "\";d
        next d
        #r "backcolor lightgray"
        #r "place 170 30; boxfilled 320 60"
        #r "place 170 80; box 320 110"
        #r "size 3; line 100 45 170 45; line 320 45 390 45"
        #r "line 100 95 170 95; line 320 95 390 95; size 1"

        xp = 100 : restore
        for c = 1 to 10
        read d$ : c$(c) = d$
        #r "backcolor ";c$(c)
        #r "place ";xp;" 200; boxfilled ";xp+20;" 240"
        xp = xp + 30
        next c
        #r "backcolor white;when leftButtonDown [pick]" : r = 1
        xr = 190 : n = 1 : v$ = "" : wait
        [show]
        #r "backcolor ";c$(k+1)
        if n < 3 then v$ = v$ + str$(k)
        if n = 1 then #r "place 170 80; boxfilled 320 110"
        if n = 2 then #r "place 170 80; boxfilled 190 110"
        if n = 3 then #r "place 250 96; circlefilled 14"
        #r "place ";xr;" 30; boxfilled ";xr+10;" 60"
        xr = xr + 20 : n = n + 1 : if n < 4 then wait
        #r "backcolor darkgray; place 250 30; boxfilled 260 60"
        #r "place 300 80; boxfilled 320 110"
        #r "color yellow; place 60 280"
        #r "\ Tolerance: Gold 5% Silver 10% Unmarked 20% "
        #r "color darkblue; backcolor white; place 160 300"
        for z = 1 to k : v$ = v$ +"0" : next
        #r "\SELECTED VALUE = ";v$ : #r "place 100 320; color black"
        #r "\Preferred values and multiples are :-"
        #r "\ 10 12 15 18 22 27 33 39 47 56 68 82"
        #r "flush" : confirm "Another?"; q$
        if q$ = "yes" then [start]
        #r "when leftButtonDown" : wait

        [pick]
        if MouseY > 240 or MouseY < 200 then wait
        x1 = 100 : x2 = 120 : c = 99 : k = 99
        for t = 1 to 10
        if MouseX > x1 and MouseX < x2 then k = t-1
        x1 = x1 + 30 : x2 = x2 + 30
        next
        if k > 9 then wait
        r = r + 1 : goto [show]

        [quit] close #r : end

        data "black","130 50 10","red","220 120 20","yellow"
        data "green","blue","150 30 200","darkgray","white"
        end
      Your message has been successfully submitted and would be delivered to recipients shortly.