i have an old .BAS file that im trying to launch. I just need the program to work - i don't need to edit or do anything with the code. Does anybody know how to run it so i can see the program - its an old solitaire game i use for an example to show how the code is written. Can i run it through visual studio 2010 - if yes how? Or with program should i use to launch it?
Public Class Form1
SCREEN 9,0 'medium resolution'
FORGRUND%=4
BAGGRUND%=63
PILE%=9
DUG%=2
RUNDE%=1
ANTFLYT%=0
ANTKONGER%=0
KONGE13%=0
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
OPTION BASE 1 'laveste v‘rdi i tabeller s‘ttes til 1'
'*********************************************************'
' en lille startmelodi til at komme ignag med'
'*********************************************************'
'PLAY "mb o3 l8 ffffafffafdfe4.l8 eeeegeeedefed4" kattekilling
PLAY "mb o3 t255 l8 df+ga2df+ga2df+gl4af+df+e2l8f+f+ed4.df+4aaag2f+gl4af+ded2"
'*********************************************************'
'lav en konverteringstabel'
'*********************************************************'
GOSUB 2060
'*********************************************************'
'lav kasser s† de er flotte'
'*********************************************************'
GOSUB 2260
'*********************************************************'
'2 tabeller: randomizer, kort'
'randomizer initieres med vilk†rlige tal'
'*********************************************************'
GOSUB 2640
'*********************************************************'
'vi skal putte kortet p† rette plads p† bordet/sk‘rmen'
'*********************************************************'
GOSUB 2840
'*********************************************************'
'l‘s bord og flyt til sk‘rm'
'*********************************************************'
GOSUB 2950
'*********************************************************'
'pr›v at l‘se F fra sk‘rm'
'*********************************************************'
X=6
Y=3
FRASKARMX%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
FRASKARMY%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
COLOR PILE%,BAGGRUND%
LOCATE X,Y:PRINT CHR$(24)
COLOR FORGRUND%,BAGGRUND%
LOCATE 23,2:PRINT"V‘lg kort der skal flyttes ved at
taste "
FUNDET=1
WHILE FUNDET 's†l‘nge F ikke er indtastet'
FT$=INKEY$:IF FT$="" THEN LOCATE 1,72:PRINT TIME$:GOTO 510
IF LEN(FT$)=1 GOTO 630
IF LEN(FT$)=2 GOTO 560 'evt. mark›r bev‘gelse'
GOTO 680 'til endwhile'
'find mark›r-bev‘gelse'
FT$=RIGHT$(FT$,1)
IF ASC(FT$)=77 THEN GOSUB 1660 'pil til h›jre'
IF ASC(FT$)=75 THEN GOSUB 1750 'pil til venstre'
IF ASC(FT$)=72 THEN GOSUB 1850 'pil op'
IF ASC(FT$)=80 THEN GOSUB 1940 'pil ned'
GOTO 680
'find bogstav'
IF (FT$<>"f") AND (FT$<>"F") AND (FT$<>"a") AND (FT$<>"A") AND (FT$<>"N") AND
(FT$<>"n") AND (FT$<>"b") AND (FT$<>"B") GOTO 680
FUNDET=0
WEND
etc
VB2005 Express has an upgrade wizard. It opens automatically when you try to open a VB6 project.
This must be VB for DOS, (versions 1.0, not sure if 2.0 was ever made), its not qb since it has forms support (QB didnt have that) and its not Windows version since it has this SCREEN and COLOR statements (for console text resolution and colors) :
SCREEN 9,0 '**medium resolution' switch 0=nocolor 1=color
mode 9 with 0 no color
SCREEN 9: 640 x 350 graphics
80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
16 colors assigned to 4 attributes (64K adapter memory), or 64 colors assigned to 16 attributes (more than 64K adapter memory)
If 64K EGA adapter memory, 1 video memory page (0); otherwise, 2 pages (0-1)
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
looking that there are GOTO and GOSUBS with line number labels and the KEY OFF command, example code was ported from GWBasic that had line numbers in it and had 25th line displaying functions keys commands (turned off by key off).
Related
I'm following vulkan-tutorial's procedure to understand vulkan, I'm now in creating swapchain. before that I've also created instance and a debug/validation layer but when I'm trying to create swapchain, the app crashes.
void createSwapChain() {
VkSurfaceFormatKHR surfaceFormat;
surfaceFormat.format=VK_FORMAT_B8G8R8A8_SRGB;
surfaceFormat.colorSpace=VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
VkPresentModeKHR presentMode=VK_PRESENT_MODE_FIFO_KHR;
int width,height;
glfwGetFramebufferSize(window, &width, &height);
VkExtent2D extent ={width,height};
uint32_t imageCount=2;//minimum cap +1
VkSurfaceCapabilitiesKHR capabilities;
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, &capabilities);
VkSwapchainCreateInfoKHR createInfo={0};
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
createInfo.surface = surface;
createInfo.minImageCount = imageCount;
createInfo.imageFormat = surfaceFormat.format;
createInfo.imageColorSpace = surfaceFormat.colorSpace;
createInfo.imageExtent = extent;
createInfo.imageArrayLayers = 1;
createInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
createInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
// createInfo.queueFamilyIndexCount = 1;
// createInfo.pQueueFamilyIndices = NULL;
createInfo.preTransform = capabilities.currentTransform/*VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR*/;//swapChainSupport.capabilities.currentTransform
createInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
createInfo.presentMode = presentMode;
createInfo.clipped = VK_TRUE;// means obscured images have unimportant color!!
createInfo.oldSwapchain = VK_NULL_HANDLE;
if (vkCreateSwapchainKHR(device, &createInfo, NULL, &swapChain) != VK_SUCCESS)
printf("failed to create swap chain!");
}
Is there any idea? The host is eclipse with MinGW-64 -lglfw3 and -lvulkan-1 on windows 10 64-bit.
And here the graphic card information:
Available Layers:
VK_LAYER_AMD_switchable_graphics
VK_LAYER_VALVE_steam_overlay
VK_LAYER_VALVE_steam_fossilize
VK_LAYER_KHRONOS_validation
Available extensions:
VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_KHR_win32_surface
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_swapchain_colorspace
Instance extension:
VK_KHR_surface
VK_KHR_win32_surface
VK_EXT_debug_utils
Availible devices:
AMD Radeon(TM) Graphics Type: 1 GeometryShader: Yes
FamilyIndex: 0 AvailibleQueueCount: 1 Surface Support: Yes Graphics | Compute | Transfer | Binding
FamilyIndex: 1 AvailibleQueueCount: 2 Surface Support: Yes | Compute | Transfer | Binding
FamilyIndex: 2 AvailibleQueueCount: 1 Surface Support: Yes | | Transfer | Binding
Availible device extensions: (The required is VK_KHR_swapchain)
VK_KHR_16bit_storage VK_KHR_8bit_storage VK_KHR_bind_memory2
VK_KHR_buffer_device_address VK_KHR_copy_commands2 VK_KHR_create_renderpass2
VK_KHR_dedicated_allocation VK_KHR_depth_stencil_resolve VK_KHR_descriptor_update_template
VK_KHR_device_group VK_KHR_draw_indirect_count VK_KHR_driver_properties
VK_KHR_dynamic_rendering VK_KHR_external_fence VK_KHR_external_fence_win32
VK_KHR_external_memory VK_KHR_external_memory_win32 VK_KHR_external_semaphore
VK_KHR_external_semaphore_win32 VK_KHR_format_feature_flags2 VK_KHR_get_memory_requirements2
VK_KHR_global_priority VK_KHR_imageless_framebuffer VK_KHR_image_format_list
VK_KHR_maintenance1 VK_KHR_maintenance2 VK_KHR_maintenance3
VK_KHR_maintenance4 VK_KHR_multiview VK_KHR_pipeline_executable_properties
VK_KHR_pipeline_library VK_KHR_push_descriptor VK_KHR_relaxed_block_layout
VK_KHR_sampler_mirror_clamp_to_edge VK_KHR_sampler_ycbcr_conversion VK_KHR_separate_depth_stencil_layouts
VK_KHR_shader_atomic_int64 VK_KHR_shader_clock VK_KHR_shader_draw_parameters
VK_KHR_shader_float16_int8 VK_KHR_shader_float_controls VK_KHR_shader_integer_dot_product
VK_KHR_shader_non_semantic_info VK_KHR_shader_subgroup_extended_types VK_KHR_shader_subgroup_uniform_control_flow
VK_KHR_shader_terminate_invocation VK_KHR_spirv_1_4 VK_KHR_storage_buffer_storage_class
Swap chain details:
Min/max images in swap chain; 1, 16
Min/max width and height 800 : 600 | 800 : 600
Pixel format codes(at least we need one no matter what!): 44
50 58 97 44 50 58 97 58 97 58
97 97 2 3 4 5 8 37 38 43
45 51 52 57 64 91 92 122
color space codes(at least we need one no matter what!): 0
0 0 0 1000104006 1000104006 1000104006 1000104006 1000104008 1000104008 1000104007
1000104007 1000104002 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
Available presentation modes:
0 (Immediate)
2 3 ( FIFO, FIFO_relaxed)
A few things:
There isn't really enough information in the problem description to allow others to locate the problem. For example, we can't tell how surface got created and we can't tell how the Vulkan device got created. It is better to post a complete reproducible example someplace and point to it.
There are a lot of hits when searching for "vulkan swapchain exception" like this one and this one. Something there may give a clue.
Based on what is provided and the links mentioned above, my best guess is that you're not enabling the swapchain extension when creating the device. Perhaps you could check that?
The validation layer should be helpful and you can find more information about it here. You might try making a vk_layer_settings.txt file and use it to set the message severity to "info" so that you can verify that the layer is active. (It will print some sort of startup message at this level) Your IDE might be swallowing the text output coming from the validation layer and the point behind doing this is to verify that you can see any validation output. It may be easier to provide a log filename in the same settings file to send the validation output to that file instead of figuring out what the IDE is doing. You can also use the vkconfig tool to apply these sorts of settings to the validation layer.
Goal of a code:
Timer CheckStart iterrates every 3 seconds until it find a choosen color.
If it finds pixel - it stops itself and start CheckStop timer, to look for another pixel every 3 seconds.
Rince and repeat
Also there is a keybind to check which timer was launched last.
#NoEnv
SendMode Input
checkstate = 0 ;just for checking state
SetTimer, CheckStart, 3000
Return
CheckStart:
PixelSearch, xx, zz, 710, 460, 730, 480, 0x385982, 0, Alt RGB
if !ErrorLevel {
checkstate = 1
SetTimer, CheckStart, Off
SetTimer, CheckEnd, 3000
Gosub, CheckEnd
}
Return
CheckEnd:
PixelSearch, xx, zz, 670, 160, 725, 200, 0xE60014, 0, Alt RGB
if !ErrorLevel {
checkstate = 0
SetTimer, CheckEnd, Off
SetTimer, CheckStart, 3000
Gosub, CheckStart
}
Return
^!z:: ; Control+Alt+Z
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%, Alt RGB
MsgBox (checkstate%) colour: %color%.
return
What I'm getting:
Before i feed needed color to 1st timer, keybind works delayed, shows state only between iterrations. Can i make it async?
After i feed needed color to 1st timer, checker became "1", but CheckEnd timer not starting. (and so keybind start to work immediately)
What i'm doing wrong? or its just prohibited to launch timer by timer?
There is no such pixel search mode as Alt, that's only for PixelGetColor.
I'm going to assume the problem here is just the pixel search taking forever.
Add in the Fast mode.
So instead of Alt RGB try Fast RGB.
I'm using cp 932 and trying to get the output as i scripted:
#echo off
chcp 932
cls
echo a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n
echo.
echo あいうえお きかくけこ さしすせそ たちつてと なにぬねの はひふへほ まみむめも やゆよ らりるれろ わをん
echo.
echo アイウエオ カキクケコ サシスセソ タチツテト ナニヌネノ ハヒフヘホ マミムメモ ヤユヨ ラリルレロ ワヲン
pause>nul
but i get the following output:
a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he
ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n
縺ゅ>縺・∴縺翫縺阪°縺上¢縺薙縺輔@縺吶○縺昴縺溘■縺、縺ヲ縺ィ縲縺ェ縺ォ縺ャ縺ュ縺ョ縲縺ッ縺イ縺オ縺ク縺サ縲縺セ縺ソ繧繧√b縲繧・f繧医繧峨j繧九l繧阪繧上r繧・
繧「繧、繧ヲ繧ィ繧ェ縲繧ォ繧ュ繧ッ繧ア繧ウ縲繧オ繧キ繧ケ繧サ繧ス縲繧ソ繝√ヤ繝・ヨ縲繝翫ル繝後ロ繝弱繝上ヲ繝輔・繝帙繝槭Α繝繝。繝「縲繝、繝ヲ繝ィ縲繝ゥ繝ェ繝ォ繝ャ繝ュ縲繝ッ繝イ繝ウ
How to display the right characters?
There is no problem. As you can see, I'm on (Central European) Windows with Latin script:
You need to save the script using right encoding:
Moreover, Windows itself switch to right font (my default cmd font is set to Courier New with no CJK script):
You can convert text to Base64 and Decode it in Vbscript to show text.
Save whole code bellow as a .vbs and run it.(Don't run it via cscript or wscript).
Try my way :
Str="44GC44GE44GG44GI44GK44CA44GN44GL44GP44GR44GT44CA44GV44GX44GZ44Gb44Gd44CA44Gf44Gh44Gk44Gm44Go44CA44Gq44Gr44Gs44Gt44Gu44CA44Gv44Gy44G144G444G744CA44G+44G/44KA44KB44KC44CA44KE44KG44KI44CA44KJ44KK44KL44KM44KN44CA44KP44KS44KT"
St="44Ki44Kk44Km44Ko44Kq44CA44Kr44Kt44Kv44Kx44Kz44CA44K144K344K544K744K944CA44K/44OB44OE44OG44OI44CA44OK44OL44OM44ON44OO44CA44OP44OS44OV44OY44Ob44CA44Oe44Of44Og44Oh44Oi44CA44Ok44Om44Oo44CA44Op44Oq44Or44Os44Ot44CA44Ov44Oy44Oz"
'===========================================================================
Function Base64Decode(ByVal vCode)
Set oNode = CreateObject("Msxml2.DOMDocument.3.0").CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.text = vCode
Base64Decode = Stream_BinaryToString(oNode.nodeTypedValue)
Set oNode = Nothing
End Function
Function Stream_BinaryToString(Binary)
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = 1
BinaryStream.Open
BinaryStream.Write Binary
BinaryStream.Position = 0
BinaryStream.Type = 2
BinaryStream.CharSet = "utf-8"
Stream_BinaryToString = BinaryStream.ReadText
Set BinaryStream = Nothing
End Function
WSH.Echo "a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n"&vblf&Vblf&Base64Decode(Str)&vblf&Vblf&Base64Decode(St)
I have a CLI App that scraps 5 different deals page and save it into ##all class variable. I want all of them to have a new variable which should start from 1 to 100(because there are total 100 deals). I tried a lot but it just shows number 1 for all the deals.
def deals_listing
all_deals = PopularDeals::NewDeals.all
#deals = []
all_deals.collect do |deal_info|
i = 1
deal_info.number = i
#deals << deal_info
i = i + 1
end
#deals
binding.pry
end
The sample of output that I am getting is..
pry(#<PopularDeals::CLI>)> #deals
=> [#<PopularDeals::NewDeals:0x00000001aaf220
#deal_rating="+7",
#number=1,
#posted="Posted Today",
#price="$7.64",
#title=
"Back Again at Amazon Campbell's Slow Cooker Sauces, Apple Bourbon Pulled Pork, 13 Ounce (Pack of 6) as low as $7.64 w/ Subscribe and Save S&S w/ Free Shipping",
#url=
"https://slickdeals.net/f/10033448-back-again-at-amazon-campbell-s-slow-cooker-sauces-apple-bourbon-pulled-pork-13-ounce-pack-of-6-as-low-as-7-64-w-subscribe-and-save-s-
s-w-free-shipping">,
#<PopularDeals::NewDeals:0x00000001a876f8
#deal_rating="+6",
#number=1,
#posted="Posted Today",
#price="$5.33",
#title=
"LUCKLED 20 LED Solar Powered Dragonfly String Lights Multi-color $5.33 AC, FS w/prime #Amazon",
#url=
ing-lights-multi-color-5-33-ac-fs-w-prime-amazon">,
#<PopularDeals::NewDeals:0x00000001a84228
#deal_rating="+6",
#number=1,
#posted="Posted Today",
#price="$339.99",
#title=
ping # Walmart",
#url=
efurbished-339-99-free-shipping-walmart">,
#<PopularDeals::NewDeals:0x00000001a80ad8
#deal_rating="+6",
#number=1,
:
What I would like to have..
pry(#<PopularDeals::CLI>)> #deals
=> [#<PopularDeals::NewDeals:0x00000001aaf220
#deal_rating="+7",
#number=1,
#posted="Posted Today",
#price="$7.64",
#title=
"Back Again at Amazon Campbell's Slow Cooker Sauces, Apple Bourbon Pulled Pork, 13 Ounce (Pack of 6) as low as $7.64 w/ Subscribe and Save S&S w/ Free Shipping",
#url=
"https://slickdeals.net/f/10033448-back-again-at-amazon-campbell-s-slow-cooker-sauces-apple-bourbon-pulled-pork-13-ounce-pack-of-6-as-low-as-7-64-w-subscribe-and-save-s-
s-w-free-shipping">,
#<PopularDeals::NewDeals:0x00000001a876f8
#deal_rating="+6",
#number=2,
#posted="Posted Today",
#price="$5.33",
#title=
"LUCKLED 20 LED Solar Powered Dragonfly String Lights Multi-color $5.33 AC, FS w/prime #Amazon",
#url=
ing-lights-multi-color-5-33-ac-fs-w-prime-amazon">,
#<PopularDeals::NewDeals:0x00000001a84228
#deal_rating="+6",
#number=3,
#posted="Posted Today",
#price="$339.99",
#title=
ping # Walmart",
#url=
efurbished-339-99-free-shipping-walmart">,
#<PopularDeals::NewDeals:0x00000001a80ad8
#deal_rating="+6",
#number=4,
:
Any suggestions to make it work? Thank you so much in advance.
If you want to populate the property of an object with its position within some array:
#deals = PopularDeals::NewDeals.all.each_with_index.map do |deal, i|
deal.number = i
deal
end
That allows you to fetch, iterate, and assign in one pass with a minimal amount of mess. The each_with_index method gives you simple index for each element, and map allows you to convert that into your final array.
Well, this issue is solved. I got an answer. If anyone else is trying to do something like this, this is what I did.
def deals
all_deals = PopularDeals::NewDeals.all
#deals = []
all_deals.collect do |deal_info|
deal_info.number = all_deals.index(deal_info).to_i + 1
#deals << deal_info
end
#deals
end
I used .index method to find index number and added one to it so, it starts from 1, and assigned it to deal_info.number
I have a sql database with data about headers of news. Example:
id title
867 MPE consegue inverter julgamento
868 Defensoria P blica realiza licita
869 Prefeitos eleitos de todas as partes do Estado
870 Inc ndio deixa 80 pessoas desabrigadas
871 Carlos Amastha visita parlamentares
872 Defensoria P blica requer anula o
873 Marcelo Miranda diz que n o possui obriga o
874 Ex-assessor diz que Coimbra lhe deu dois cheques
I need to get each title and see if there are other news to talk about the same subject.
How i do it? My plataform is .Net and use sql server 2012.
You will probably want to put a Full-Text Index on this column and/or table. It's a complex subject, but you can start reading up on it here: http://msdn.microsoft.com/en-us/library/ms142571.aspx