I found a nice library for LCD bargraphs and wanted to use it in some project.But it was not written in JAL, so I tried to convert it, but something is not working.
Anyway here is what I have:
This is for Bascom AVR

Dim Limit As Word
If BAR_Width = 0 Then ' If BAR_Width = 0, do nothing
Exit
End If
If Style <> BAR_Style Then ' If style changed, the load the
Char_Set(Style) ' new style to LCD CGRAM....
End If
BAR_Temp = Row[BAR_Row] ' Define at which row the bar is
LCD_Cmd(BAR_Temp + BAR_Col - 1) ' Move cursor to bar grpah start
Calculate(BAR_Value, BAR_Width, BAR_Range) ' Make complicated calculations
For BAR_Loop = 0 To (BAR_Width - 1)
If BAR_Temp > BAR_Loop Then
LCD_Chr_CP(ThreeBars) ' Send 3 bars
End If
If BAR_Temp < BAR_Loop Then
LCD_Chr_CP(Boarder) ' Clear to end of bar width
End If
If BAR_Temp = BAR_Loop Then
Limit = BAR_Range * 6
Limit = Limit Div 10
If Remainder >= Limit Then
LCD_Chr_CP(TwoBars) ' Send 2 bars
Else
Limit = BAR_Range * 3
Limit = Limit Div 10
If Remainder >= Limit Then
LCD_Chr_CP(OneBar) ' Send 1 bar
Else
LCD_Chr_CP(Boarder) ' No bars sent
End If
End If
End If
Next Bar_Loop
End Sub
End.

And this is my conversion for JAL v2, but it does not work.

Quote:

-- Module LCD_BarGraph_16_Module
-- Written by picmicroman for mikrobasic then changed for jal
-- Based on darrel taylor code work
-- How to use
-- Value Row, Col, Width, Range , Style
-- LCD_BarGraph_Draw( Value , 1 , 1 , 16 , 255 , Lines )
--
-- LCD_BarGraph_Draw( Value , 2 , 1 , 16 , 255 , Boxes )
--
-- LCD_BarGraph_Draw( Value , 3 , 1 , 16 , 255 , Blocks)
-- The Value of the BARgraph (0 to Range).
-- If Range = 100 and Value is 50, then half of the BARgraph will be filled in.
-- Value MUST be a WORD sized variable.
-- LCD Row to place the BARgraph (1 to 4)
-- can be either a constant or a variable.
-- LCD Column to place the BARgraph (0 to LCDsize - 1)
-- can be either a constant or a variable.
-- LCDsize is the number of Chars in 1 line of the LCD, for "4x16" it's 16
-- Width of the BARgraph in charaters. (1 to LCDsize)
-- can be either a constant or a variable.
-- Range is the "full-scale" range of the BARgraph (0 to 32768)
-- MUST be a constant. Variables will not work here.
-- Style selects which Style will be used for the BARgraph (lines, boxed, blocks)
-- can be either a constant or a variable.

Var Word Limit
If (BAR_Width == 0) Then -- If BAR_Width = 0, do nothing
return
End If
If Style != BAR_Style Then -- If style changed, the load the
Char_Set(Style) -- new style to LCD CGRAM....
End If
BAR_Temp = Row[BAR_Row] -- Define at which row the bar is
_lcd_write_command(BAR_Temp + (BAR_Col - 1)) -- Move cursor to bar grpah

O.K, here the new version.Now it works, but there is some unexpected behaviour.
First: the bar is shown on the wrong line.
Second: Although there is no command to change the column "lcd_cursor_position(BAR_Row, BAR_Col)" here , it does change it.Actually it is not a fault, it must change the column to work, but I don't understand how it happens.

Quote:

-- Module LCD_BarGraph_16_Module
-- Written by picmicroman for mikrobasic then changed for jal
-- Based on darrel taylor code work
-- How to use:
-- LCD_BarGraph_Init -- Init LCD bar graph
-- Value Row, Col, Width, Range , Style
-- LCD_BarGraph_Draw( Value , 1 , 0 , 16 , 255 , Lines )
--
-- LCD_BarGraph_Draw( Value , 2 , 0 , 16 , 255 , Boxes )
--
-- LCD_BarGraph_Draw( Value , 3 , 0 , 16 , 255 , Blocks)
-- The Value of the BARgraph (0 to Range).
-- If Range = 100 and Value is 50, then half of the BARgraph will be filled in.
-- Value MUST be a WORD sized variable.
-- LCD Row to place the BARgraph (1 to 4)
-- can be either a constant or a variable.
-- LCD Column to place the BARgraph (0 to LCDsize - 1)
-- can be either a constant or a variable.
-- LCDsize is the number of Chars in 1 line of the LCD, for "4x16" it's 16
-- Width of the BARgraph in charaters. (1 to LCDsize)
-- can be either a constant or a variable.
-- Range is the "full-scale" range of the BARgraph (0 to 32768)
-- MUST be a constant. Variables will not work here.
-- Style selects which Style will be used for the BARgraph (lines, boxed, blocks)
-- can be either a constant or a variable.

Var Word Limit
Var Byte BAR_Loop = 0
If (BAR_Width == 0) Then -- If BAR_Width = 0, do nothing
return
End If
If Style != BAR_Style Then -- If style changed, the load the
Char_Set(Style) -- new style to LCD CGRAM....
End If